Пример #1
0
 private static void DisposeContext(OperationContext context)
 {
     if (context != null)
     {
         context.Dispose();
     }
 }
Пример #2
0
        public void Dispose_OnNewContext_InnerContainerIsDisposed()
        {
            OperationContext context = OperationContext.CreateNew();

            context.Dispose();

            Assert.True(this.lastChildContainer.Disposed);
        }
Пример #3
0
 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]);
         }
     }
 }
Пример #4
0
            public void Dispose()
            {
                if (context != null)
                {
                    context.Dispose();
                }

                IDisposable disposable = serviceLocator as IDisposable;

                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
 /// <nodoc />
 public void Dispose()
 {
     m_worker.OnPipExecutionCompletion(m_runnablePip);
     m_operationContext.Dispose();
 }