internal CimAsyncCancellationDisposable(CimOperation operation)
		{
			this._disposeThreadSafetyLock = new object();
			this._securityContext = SecurityContext.Capture();
			this._operation = operation;
		}
Ejemplo 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();
 }
Ejemplo n.º 4
0
		private static void DisposeOperationWhenPossibleWorker(CimOperation cimOperation)
		{
			cimOperation.Handle.SetExtraFinalizationAction(null);
			cimOperation.IgnoreSubsequentCancellationRequests();
			cimOperation.Dispose();
		}
Ejemplo n.º 5
0
		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;
            }
        }
Ejemplo n.º 7
0
		internal static void RemoveTracking(CimOperation cimOperation)
		{
			CimApplication.TrackedCimOperations.Remove(cimOperation);
		}
Ejemplo n.º 8
0
		internal static void AddTracking(CimOperation cimOperation)
		{
			CimApplication.TrackedCimOperations.Add(cimOperation);
		}