mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-07 23:33:52 +00:00
PowerControl: Apply profile changes in bulk
This commit is contained in:
parent
b7d7ad677e
commit
4bcefc703e
4 changed files with 64 additions and 37 deletions
17
CommonHelpers/Dispatcher.cs
Normal file
17
CommonHelpers/Dispatcher.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
namespace CommonHelpers
|
||||
{
|
||||
public static class Dispatcher
|
||||
{
|
||||
public static CancellationTokenSource RunWithDelay(int delayMs, Action action)
|
||||
{
|
||||
var cancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
Task.Delay(1000, cancellationTokenSource.Token).ContinueWith(_ =>
|
||||
{
|
||||
System.Windows.Threading.Dispatcher.CurrentDispatcher.Invoke(action);
|
||||
});
|
||||
|
||||
return cancellationTokenSource;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue