Ejemplo n.º 1
0
 public override void Dispose()
 {
     watcher.Cancel();
     watcher.Changed -= WatcherChanged;
     watcher.Dispose();
     base.Dispose();
 }
Ejemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (_fileTransferSubject != null)
            {
                _fileTransferSubject.Dispose();
            }

            if (_monitorObserver != null)
            {
                _monitorObserver.Dispose();
            }

            if (_monitor != null)
            {
                _monitor.Dispose();
            }

            if (_fileScanCts != null)
            {
                _fileScanCts.Cancel();
                _fileScanCts.Dispose();
            }

            if (_fileCopyCts != null)
            {
                _fileCopyCts.Cancel();
                _fileCopyCts.Dispose();
            }

            if (_fileTranferLoopCts != null)
            {
                _fileTranferLoopCts.Cancel();
                _fileTranferLoopCts.Dispose();
            }
        }
Ejemplo n.º 3
0
 void StopWatcher()
 {
     if (watcher != null)
     {
         watcher.Cancel();
         watcher.Changed -= WatcherChanged;
         watcher.Dispose();
         watcher = null;
     }
 }
Ejemplo n.º 4
0
 public void Dispose()
 {
     reboot_required_monitor.Cancel();
     reboot_required_monitor.Changed -= HandleRebootRequired;
     reboot_required_monitor.Dispose();
 }
Ejemplo n.º 5
0
 public void DisposeDoesNotThrow()
 {
     var monitor = new FileMonitor(this.file.FullName);
     monitor.Dispose();
 }
Ejemplo n.º 6
0
 public void Dispose()
 {
     instance.Dispose();
     watcher.Verify(item => item.Dispose());
 }