internal CimAsyncCancellationDisposable(CimOperation operation)
		{
			this._disposeThreadSafetyLock = new object();
			this._securityContext = SecurityContext.Capture();
			this._operation = operation;
		}
Exemplo n.º 2
0
 internal CimAsyncCancellationDisposable(CimOperation operation)
 {
     this._disposeThreadSafetyLock = new object();
     this._securityContext         = SecurityContext.Capture();
     this._operation = operation;
 }
 private static void DisposeOperationWhenPossibleWorker(CimOperation cimOperation)
 {
     cimOperation.IgnoreSubsequentCancellationRequests();
     cimOperation.Dispose();
 }
		private static void DisposeOperationWhenPossibleWorker(CimOperation cimOperation)
		{
			cimOperation.Handle.SetExtraFinalizationAction(null);
			cimOperation.IgnoreSubsequentCancellationRequests();
			cimOperation.Dispose();
		}
		internal void SetOperation(CimOperation operation)
		{
			List<Action<CimOperation>> actions = this._operationPendingActions;
			lock (this._operationLock)
			{
				this._operation = operation;
				this._operationPendingActions = null;
			}
			operation.Cancelled += new EventHandler<EventArgs>(this.SupressCallbacksWhenRequestedViaCancellation);
			this.SupressCallbacksWhenRequestedViaCancellation(operation, EventArgs.Empty);
			if (actions != null)
			{
				foreach (Action<CimOperation> action in actions)
				{
					action(operation);
				}
			}
		}
        private void ProcessEndOfResultsWorker(OperationCallbackProcessingContext callbackProcessingContext, CimOperation cimOperation, Exception exception)
        {
            if (exception != null)
            {
                CancellationMode cancellationMode  = cimOperation.CancellationMode;
                CancellationMode cancellationMode1 = cancellationMode;
                switch (cancellationMode1)
                {
                case CancellationMode.NoCancellationOccured:
                case CancellationMode.IgnoreCancellationRequests:
                {
                    this.OnErrorInternal(callbackProcessingContext, exception);
                    return;
                }

                case CancellationMode.ThrowOperationCancelledException:
                {
                    this.OnErrorInternal(callbackProcessingContext, new OperationCanceledException(exception.Message, exception));
                    return;
                }

                case CancellationMode.SilentlyStopProducingResults:
                {
                    return;
                }

                default:
                {
                    return;
                }
                }
            }
            else
            {
                this.OnCompletedInternal(callbackProcessingContext);
                return;
            }
        }
Exemplo n.º 7
0
		internal static void RemoveTracking(CimOperation cimOperation)
		{
			CimApplication.TrackedCimOperations.Remove(cimOperation);
		}
Exemplo n.º 8
0
		internal static void AddTracking(CimOperation cimOperation)
		{
			CimApplication.TrackedCimOperations.Add(cimOperation);
		}