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(); }); }
protected override void OnDetaching() { base.OnDetaching(); AssociatedObject.LayoutUpdated -= OnDataGridUpdated; AssociatedObject.Columns.CollectionChanged -= OnColumnsCollectionChanged; _updateAction.Dispose(); }
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; } }
protected virtual void Dispose(bool disposing) { if (_workFolderWatcher != null) { _workFolderWatcher.Dispose(); _workFolderWatcher = null; } if (_delayedWorkFolderStateChanged != null) { _delayedWorkFolderStateChanged.Dispose(); _delayedWorkFolderStateChanged = null; } }
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; }