示例#1
0
        public static void TestObjectDisposedException()
        {
            DelayedAction delayedAction = new DelayedAction(() => { }, new TimeSpan(0, 0, 0, 0, 1), null);

            delayedAction.Dispose();
            Assert.Throws <ObjectDisposedException>(() => { delayedAction.RestartIdleTimer(); });
        }
        public static void TestObjectDisposedException()
        {
            FakeSleep     fakeSleep     = new FakeSleep();
            DelayedAction delayedAction = new DelayedAction(new FakeDelayTimer(fakeSleep), new TimeSpan(0, 0, 0, 0, 1));

            delayedAction.Dispose();
            Assert.Throws <ObjectDisposedException>(() => { delayedAction.StartIdleTimer(); });
        }
示例#3
0
        protected override void OnDetaching()
        {
            base.OnDetaching();

            AssociatedObject.LayoutUpdated             -= OnDataGridUpdated;
            AssociatedObject.Columns.CollectionChanged -= OnColumnsCollectionChanged;

            _updateAction.Dispose();
        }
示例#4
0
 public void DisposalPrepare()
 {
     if (_terminalBridge != null)
     {
         _terminalBridge.DisposalPrepare();
         _terminalBridge = null;
     }
     _optionsChanged.Dispose();
     ViewModel = null;
 }
 protected virtual void Dispose(bool disposing)
 {
     if (!disposing)
     {
         return;
     }
     if (_action != null)
     {
         _action.Dispose();
         _action = null;
     }
 }
示例#6
0
 protected virtual void Dispose(bool disposing)
 {
     if (_workFolderWatcher != null)
     {
         _workFolderWatcher.Dispose();
         _workFolderWatcher = null;
     }
     if (_delayedWorkFolderStateChanged != null)
     {
         _delayedWorkFolderStateChanged.Dispose();
         _delayedWorkFolderStateChanged = null;
     }
 }
示例#7
0
 protected virtual void Dispose(bool disposing)
 {
     if (_disposed)
     {
         return;
     }
     if (disposing)
     {
         if (_fileSystemWatcher != null)
         {
             _fileSystemWatcher.Dispose();
             _fileSystemWatcher = null;
         }
         if (_delayedAction != null)
         {
             _delayedAction.Dispose();
             _delayedAction = null;
         }
     }
     _disposed = true;
 }