mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-15 22:31:40 +02:00
Add WindowsUtils.CreateSingleTickTimer
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TweetDck.Core.Utils{
|
||||
static class WindowsUtils{
|
||||
@@ -29,5 +30,14 @@ namespace TweetDck.Core.Utils{
|
||||
|
||||
return Process.Start(processInfo);
|
||||
}
|
||||
|
||||
public static Timer CreateSingleTickTimer(int timeout){
|
||||
Timer timer = new Timer{
|
||||
Interval = timeout
|
||||
};
|
||||
|
||||
timer.Tick += (sender, args) => timer.Stop();
|
||||
return timer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user