private static void Start() { const string bookpath = @"C:\Users\Sean\Source\Repos\PluralSight_IDisposableBestPractices\Sixeyed.Disposable\books"; var archiver = new FolderWatcher(); archiver.Start(bookpath, "*.txt", ProcessFile); Console.WriteLine($"Listening on {bookpath}"); }
private static void Stop() { if (Watcher != null) { Watcher.Dispose(); Watcher = null; } }
private static void Start() { Watcher = new FolderWatcher(); Watcher.Start(@"c:\books", "*.txt", ProcessFile); Console.WriteLine("Listening on c:\\books"); }