Beispiel #1
0
        /// <summary>
        /// <para>
        /// Handler used to handle new operation event from
        /// <seealso cref="CimSessionProxy"/> object.
        /// </para>
        /// </summary>
        /// <param name="cimSession">
        /// <seealso cref="CimSession"/> object raised the event
        /// </param>
        /// <param name="actionArgs">Event argument.</param>
        protected void OperationCreatedHandler(object cimSession, OperationEventArgs actionArgs)
        {
            DebugHelper.WriteLogEx();

            lock (this.myLock)
            {
                this.operationCount++;
            }
        }
 protected void OperationCreatedHandler(object cimSession, OperationEventArgs actionArgs)
 {
     DebugHelper.WriteLogEx();
     lock (this.myLock)
     {
         CimAsyncOperation cimAsyncOperation = this;
         cimAsyncOperation.operationCount = cimAsyncOperation.operationCount + 1;
     }
 }
		protected override void PreOperationDeleteEvent(OperationEventArgs args)
		{
			object[] objArray = new object[1];
			objArray[0] = args.success;
			DebugHelper.WriteLogEx("test connection result {0}", 0, objArray);
			if (args.success)
			{
				CimWriteResultObject cimWriteResultObject = new CimWriteResultObject(base.CimSession, base.ContextObject);
				base.FireNewActionEvent(cimWriteResultObject);
			}
		}
 protected override void PreOperationDeleteEvent(OperationEventArgs args)
 {
     object[] objArray = new object[1];
     objArray[0] = args.success;
     DebugHelper.WriteLogEx("test connection result {0}", 0, objArray);
     if (args.success)
     {
         CimWriteResultObject cimWriteResultObject = new CimWriteResultObject(base.CimSession, base.ContextObject);
         base.FireNewActionEvent(cimWriteResultObject);
     }
 }
Beispiel #5
0
        /// <summary>
        /// <para>
        /// Handler used to handle operation deletion event from
        /// <seealso cref="CimSessionProxy"/> object.
        /// </para>
        /// </summary>
        /// <param name="cimSession">
        /// <seealso cref="CimSession"/> object raised the event
        /// </param>
        /// <param name="actionArgs">Event argument.</param>
        protected void OperationDeletedHandler(object cimSession, OperationEventArgs actionArgs)
        {
            DebugHelper.WriteLogEx();

            lock (this.myLock)
            {
                this.operationCount--;
                if (this.operationCount == 0)
                {
                    this.moreActionEvent.Set();
                }
            }
        }
Beispiel #6
0
		protected void OperationDeletedHandler(object cimSession, OperationEventArgs actionArgs)
		{
			DebugHelper.WriteLogEx();
			lock (this.myLock)
			{
				CimAsyncOperation cimAsyncOperation = this;
				cimAsyncOperation.operationCount = cimAsyncOperation.operationCount - 1;
				if (this.operationCount == 0)
				{
					this.moreActionEvent.Set();
				}
			}
		}
Beispiel #7
0
		protected void OperationCreatedHandler(object cimSession, OperationEventArgs actionArgs)
		{
			DebugHelper.WriteLogEx();
			lock (this.myLock)
			{
				CimAsyncOperation cimAsyncOperation = this;
				cimAsyncOperation.operationCount = cimAsyncOperation.operationCount + 1;
			}
		}
Beispiel #8
0
 /// <summary>
 /// <para>
 /// Trigger an event that an operation is deleted
 /// </para>
 /// </summary>
 /// <param name="operation"></param>
 private void FireOperationDeletedEvent(
     IObservable<object> operation,
     bool success)
 {
     DebugHelper.WriteLogEx();
     this.WriteOperationCompleteMessage(this.operationName);
     OperationEventArgs args = new OperationEventArgs(
         null, operation, success);
     PreOperationDeleteEvent(args);
     OperationEventHandler temp = this.OnOperationDeleted;
     if (temp != null)
     {
         temp(this.session, args);
     }
     this.PostOperationDeleteEvent(args);
     this.RemoveOperation(operation);
     this.operationName = null;
 }
Beispiel #9
0
        /// <summary>
        /// <para>
        /// Trigger an event that new operation is created
        /// </para>
        /// </summary>
        /// <param name="cancelOperation"></param>
        /// <param name="operation"></param>
        private void FireOperationCreatedEvent(
            IDisposable cancelOperation,
            IObservable<object> operation)
        {
            DebugHelper.WriteLogEx();

            OperationEventArgs args = new OperationEventArgs(
                cancelOperation, operation, false);
            OperationEventHandler temp = this.OnOperationCreated;
            if (temp != null)
            {
                temp(this.session, args);
            }
            this.PostOperationCreateEvent(args);
        }
Beispiel #10
0
        /// <summary>
        /// Called after operation delete event
        /// </summary>
        /// <param name="args"></param>
        protected override void PreOperationDeleteEvent(OperationEventArgs args)
        {
            DebugHelper.WriteLogEx("test connection result {0}", 0, args.success);

            if (args.success)
            {
                // test connection success, write session object to pipeline
                CimWriteResultObject result = new CimWriteResultObject(this.CimSession, this.ContextObject);
                this.FireNewActionEvent(result);
            }
        }
Beispiel #11
0
 /// <summary>
 /// Called after operation delete event
 /// </summary>
 /// <param name="args"></param>
 protected virtual void PostOperationDeleteEvent(OperationEventArgs args)
 {
 }
Beispiel #12
0
        /// <summary>
        /// <para>
        /// Handler used to handle new operation event from
        /// <seealso cref="CimSessionProxy"/> object.
        /// </para>
        /// </summary>
        /// <param name="cimSession">
        /// <seealso cref="CimSession"/> object raised the event
        /// </param>
        /// <param name="actionArgs">event argument</param>
        protected void OperationCreatedHandler(object cimSession, OperationEventArgs actionArgs)
        {
            DebugHelper.WriteLogEx();

            lock (this.myLock)
            {
                this.operationCount++;
            }
        }
Beispiel #13
0
		private void FireOperationDeletedEvent(IObservable<object> operation, bool success)
		{
			DebugHelper.WriteLogEx();
			this.WriteOperationCompleteMessage(this.operationName);
			OperationEventArgs operationEventArg = new OperationEventArgs(null, operation, success);
			this.PreOperationDeleteEvent(operationEventArg);
			CimSessionProxy.OperationEventHandler operationEventHandler = this.OnOperationDeleted;
			if (operationEventHandler != null)
			{
				operationEventHandler(this.session, operationEventArg);
			}
			this.PostOperationDeleteEvent(operationEventArg);
			this.RemoveOperation(operation);
			this.operationName = null;
		}
Beispiel #14
0
		private void FireOperationCreatedEvent(IDisposable cancelOperation, IObservable<object> operation)
		{
			DebugHelper.WriteLogEx();
			OperationEventArgs operationEventArg = new OperationEventArgs(cancelOperation, operation, false);
			CimSessionProxy.OperationEventHandler operationEventHandler = this.OnOperationCreated;
			if (operationEventHandler != null)
			{
				operationEventHandler(this.session, operationEventArg);
			}
			this.PostOperationCreateEvent(operationEventArg);
		}