Skip to content

Instantly share code, notes, and snippets.

@harriyott
Created Mar 30, 2018
Embed
What would you like to do?
private readonly Timer _timer = new Timer(300) { AutoReset = false, Enabled = false };
// ...
_timer.Elapsed += (s, a) =>
{
Console.Beep(1500, 200);
_timer.Enabled = false;
};
// ...
private void OnDirectoryChange(object s, FileSystemEventArgs a)
{
if (_timer.Enabled) return;
_timer.Enabled = true;
_timer.Start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment