/// <summary> /// Stops file watchers. /// </summary> private void StopAllFileWatchers() { // Avoid deadlock if all file watchers have invalid path by checking IsActive. while (!FileWatcherController.CanStopAllFileWatchers() && FileWatcherController.IsActive()) { // Wait for starting file watchers. _canStopAll.WaitOne(); } if (FileWatcherController.CanStopAllFileWatchers()) { FileWatcherController.StopAllFileWatchers(); } }
/// <summary> /// Performs stop all. /// </summary> private void StopAll() { FileWatcherController.StopAllFileWatchers(); EnableDisableControls(); }