private static void DisposeContext(OperationContext context) { if (context != null) { context.Dispose(); } }
public void Dispose_OnNewContext_InnerContainerIsDisposed() { OperationContext context = OperationContext.CreateNew(); context.Dispose(); Assert.True(this.lastChildContainer.Disposed); }
internal void UpdateStatusOperation() { if (m_workerStatusOperation.IsValid) { var status = Status; m_currentStatusOperation.Dispose(); if (status != WorkerNodeStatus.Stopped) { m_currentStatusOperation = m_workerStatusOperation.StartAsyncOperation(WorkerStatusOperationKinds[(int)status]); } } }
public void Dispose() { if (context != null) { context.Dispose(); } IDisposable disposable = serviceLocator as IDisposable; if (disposable != null) { disposable.Dispose(); } }
public void Dispose_ItemsContainsMoreDisposablesValues_AllDisposableValuesAreDisposed() { OperationContext context = GetNewTarget(); Disposable disposable1 = new Disposable(); context.Items.Add("key1", disposable1); Disposable disposable2 = new Disposable(); context.Items.Add("key2", disposable2); context.Items.Add("key3", "some item"); context.Dispose(); Assert.True(disposable1.IsDisposed); Assert.True(disposable2.IsDisposed); }
public void Dispose_ItemsContainsMoreDisposablesKeys_AllDisposableKeysAreDisposed() { OperationContext context = GetNewTarget(); Disposable disposable1 = new Disposable(); context.Items.Add(disposable1, "item 1"); Disposable disposable2 = new Disposable(); context.Items.Add(disposable2, "item 2"); context.Items.Add("some key", "some item"); context.Dispose(); Assert.True(disposable1.IsDisposed); Assert.True(disposable2.IsDisposed); }
/// <nodoc /> public void Dispose() { m_worker.OnPipExecutionCompletion(m_runnablePip); m_operationContext.Dispose(); }