protected override void OnStop() { _csvThreadControl.SendMessage -= _csvThreadControl_SendMessage; _csvThreadControl = null; _logger.RecordEvent($"CSV thread controller stopped"); _fswatcher.Stop(); _fswatcher.NewFileDetectedEvent -= _fswatcher_NewFileDetectedEvent; _fswatcher.Dispose(); _fswatcher = null; _logger.RecordEvent($"FWService stopped."); _logger = null; Thread.Sleep(1000); }
/// <summary> /// Stop file watcher /// </summary> internal static void StopFileWatcher() { _fswatcher.NewFileDetectedEvent -= FwLogger_NewFileDetectedEvent; _fswatcher.Stop(); }