Created
March 30, 2018 11:23
-
-
Save harriyott/44f3c334551d4384ff9d8e2e2ce18d33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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