/// <summary>
 /// Initializes a new instance of the <see cref="CimMethodResultObserver"/> class.
 /// </summary>
 /// <param name="session"></param>
 /// <param name="observable"></param>
 /// <param name="context"></param>
 public CimMethodResultObserver(
     CimSession session,
     IObservable <object> observable,
     CimResultContext context)
     : base(session, observable, context)
 {
 }
예제 #2
0
        /// <summary>
        /// <para>
        /// Convert ErrorRecord from exception object, <see cref="Exception"/>
        /// can be either <see cref="CimException"/> or general <see cref="Exception"/>.
        /// </para>
        /// </summary>
        /// <param name="inner"></param>
        /// <param name="context">The context starting the operation, which generated the error.</param>
        /// <param name="cimResultContext">The CimResultContext used to provide ErrorSource, etc. info.</param>
        /// <returns></returns>
        internal static ErrorRecord ErrorRecordFromAnyException(
            InvocationContext context,
            Exception inner,
            CimResultContext cimResultContext)
        {
            Debug.Assert(inner != null, "Caller should verify inner != null");

            CimException cimException = inner as CimException;

            if (cimException != null)
            {
                return(CreateFromCimException(context, cimException, cimResultContext));
            }

            var containsErrorRecord = inner as IContainsErrorRecord;

            if (containsErrorRecord != null)
            {
                return(InitializeErrorRecord(context,
                                             exception: inner,
                                             errorId: "CimCmdlet_" + containsErrorRecord.ErrorRecord.FullyQualifiedErrorId,
                                             errorCategory: containsErrorRecord.ErrorRecord.CategoryInfo.Category,
                                             cimResultContext: cimResultContext));
            }
            else
            {
                return(InitializeErrorRecord(context,
                                             exception: inner,
                                             errorId: "CimCmdlet_" + inner.GetType().Name,
                                             errorCategory: ErrorCategory.NotSpecified,
                                             cimResultContext: cimResultContext));
            }
        }
 public AsyncResultEventArgsBase(CimSession session, IObservable <object> observable, AsyncResultType resultType, CimResultContext cimResultContext)
 {
     this.session    = session;
     this.observable = observable;
     this.resultType = resultType;
     this.context    = cimResultContext;
 }
예제 #4
0
		public AsyncResultEventArgsBase(CimSession session, IObservable<object> observable, AsyncResultType resultType, CimResultContext cimResultContext)
		{
			this.session = session;
			this.observable = observable;
			this.resultType = resultType;
			this.context = cimResultContext;
		}
예제 #5
0
        /// <summary>
        /// <para>
        /// Convert ErrorRecord from exception object, <see cref="Exception"/>
        /// can be either <see cref="CimException"/> or general <see cref="Exception"/>.
        /// </para>
        /// </summary>
        /// <param name="inner"></param>
        /// <param name="context">the context starting the operation, which generated the error</param>
        /// <param name="cimResultContext">the CimResultContext used to provide ErrorSource, etc. info.</param>
        /// <returns></returns>
        internal static ErrorRecord ErrorRecordFromAnyException(
            InvocationContext context,
            Exception inner,
            CimResultContext cimResultContext)
        {
            Debug.Assert(inner != null, "Caller should verify inner != null");

            CimException cimException = inner as CimException;
            if (cimException != null)
            {
                return CreateFromCimException(context, cimException, cimResultContext);
            }

            var containsErrorRecord = inner as IContainsErrorRecord;
            if (containsErrorRecord != null)
            {
                return InitializeErrorRecord(context,
                    exception : inner,
                    errorId: "CimCmdlet_" + containsErrorRecord.ErrorRecord.FullyQualifiedErrorId,
                    errorCategory: containsErrorRecord.ErrorRecord.CategoryInfo.Category,
                    cimResultContext: cimResultContext);
            }
            else
            {
                return InitializeErrorRecord(context,
                    exception :inner,
                    errorId: "CimCmdlet_" + inner.GetType().Name,
                    errorCategory: ErrorCategory.NotSpecified,
                    cimResultContext: cimResultContext);
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CimResultObserver{T}"/> class.
 /// </summary>
 /// <param name="session"><see cref="CimSession"/> object that issued the operation.</param>
 /// <param name="observable">Operation that can be observed.</param>
 public CimResultObserver(CimSession session,
                          IObservable <object> observable,
                          CimResultContext cimResultContext)
 {
     this.CurrentSession = session;
     this.observable     = observable;
     this.context        = cimResultContext;
 }
예제 #7
0
        /// <summary>
        /// Create <see cref="ErrorRecord"/> from <see cref="CimException"/> object.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="cimException"></param>
        /// <param name="cimResultContext">the CimResultContext used to provide ErrorSource, etc. info.</param>
        /// <returns></returns>
        internal static ErrorRecord CreateFromCimException(
            InvocationContext context,
            CimException cimException,
            CimResultContext cimResultContext)
        {
            Debug.Assert(cimException != null, "Caller should verify cimException != null");

            return InitializeErrorRecord(context, cimException, cimResultContext);
        }
예제 #8
0
        /// <summary>
        /// Create <see cref="ErrorRecord"/> from <see cref="CimException"/> object.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="cimException"></param>
        /// <param name="cimResultContext">The CimResultContext used to provide ErrorSource, etc. info.</param>
        /// <returns></returns>
        internal static ErrorRecord CreateFromCimException(
            InvocationContext context,
            CimException cimException,
            CimResultContext cimResultContext)
        {
            Debug.Assert(cimException != null, "Caller should verify cimException != null");

            return(InitializeErrorRecord(context, cimException, cimResultContext));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AsyncResultErrorEventArgs"/> class.
 /// </summary>
 /// <param name="session"></param>
 /// <param name="observable"></param>
 /// <param name="error"></param>
 /// <param name="context"></param>
 public AsyncResultErrorEventArgs(
     CimSession session,
     IObservable <object> observable,
     Exception error,
     CimResultContext cimResultContext)
     : base(session, observable, AsyncResultType.Exception, cimResultContext)
 {
     this.error = error;
 }
예제 #10
0
 /// <summary>
 /// Create <see cref="ErrorRecord"/> from <see cref="Exception"/> object.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="exception"></param>
 /// <param name="errorId"></param>
 /// <param name="errorCategory"></param>
 /// <param name="cimResultContext">The CimResultContext used to provide ErrorSource, etc. info.</param>
 /// <returns></returns>
 internal static ErrorRecord InitializeErrorRecord(
     InvocationContext context,
     Exception exception,
     string errorId,
     ErrorCategory errorCategory,
     CimResultContext cimResultContext)
 {
     return(InitializeErrorRecordCore(
                context,
                exception: exception,
                errorId: errorId,
                errorCategory: errorCategory,
                cimResultContext: cimResultContext));
 }
예제 #11
0
        /// <summary>
        /// Create <see cref="ErrorRecord"/> from <see cref="Exception"/> object.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="exception"></param>
        /// <param name="errorId"></param>
        /// <param name="errorCategory"></param>
        /// <param name="cimResultContext">The CimResultContext used to provide ErrorSource, etc. info.</param>
        /// <returns></returns>
        internal static ErrorRecord InitializeErrorRecordCore(
            InvocationContext context,
            Exception exception,
            string errorId,
            ErrorCategory errorCategory,
            CimResultContext cimResultContext)
        {
            object theTargetObject = null;

            if (cimResultContext != null)
            {
                theTargetObject = cimResultContext.ErrorSource;
            }

            if (theTargetObject == null)
            {
                if (context != null)
                {
                    if (context.TargetCimInstance != null)
                    {
                        theTargetObject = context.TargetCimInstance;
                    }
                }
            }

            ErrorRecord coreErrorRecord = new ErrorRecord(
                exception: exception,
                errorId: errorId,
                errorCategory: errorCategory,
                targetObject: theTargetObject);

            if (context == null)
            {
                return(coreErrorRecord);
            }

            System.Management.Automation.Remoting.OriginInfo originInfo = new System.Management.Automation.Remoting.OriginInfo(
                context.ComputerName,
                Guid.Empty);

            ErrorRecord errorRecord = new System.Management.Automation.Runspaces.RemotingErrorRecord(
                coreErrorRecord,
                originInfo);

            DebugHelper.WriteLogEx("Created RemotingErrorRecord.", 0);
            return(errorRecord);
        }
예제 #12
0
        /// <summary>
        /// Create <see cref="ErrorRecord"/> from <see cref="CimException"/> object.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="cimException"></param>
        /// <param name="cimResultContext">the CimResultContext used to provide ErrorSource, etc. info.</param>
        /// <returns></returns>
        internal static ErrorRecord InitializeErrorRecord(
            InvocationContext context,
            CimException cimException,
            CimResultContext cimResultContext)
        {
            ErrorRecord errorRecord = InitializeErrorRecordCore(
                context,
                exception: cimException,
                errorId: cimException.MessageId ?? "MiClientApiError_" + cimException.NativeErrorCode,
                errorCategory: ConvertCimExceptionToErrorCategory(cimException),
                cimResultContext: cimResultContext);

            if (cimException.ErrorData != null)
            {
                errorRecord.CategoryInfo.TargetName = cimException.ErrorSource;
            }
            return(errorRecord);
        }
예제 #13
0
 /// <summary>
 /// Construct with an exception object
 /// </summary>
 /// <param name="exception"></param>
 public CimWriteError(Exception exception, InvocationContext context, CimResultContext cimResultContext)
 {
     this.exception         = exception;
     this.invocationContext = context;
     this.cimResultContext  = cimResultContext;
 }
예제 #14
0
        internal static ErrorRecord ErrorRecordFromAnyException(InvocationContext context, Exception inner, CimResultContext cimResultContext)
        {
            CimException cimException = inner as CimException;

            if (cimException == null)
            {
                IContainsErrorRecord containsErrorRecord = inner as IContainsErrorRecord;
                if (containsErrorRecord == null)
                {
                    return(ErrorToErrorRecord.InitializeErrorRecord(context, inner, string.Concat("CimCmdlet_", inner.GetType().Name), ErrorCategory.NotSpecified, cimResultContext));
                }
                else
                {
                    return(ErrorToErrorRecord.InitializeErrorRecord(context, inner, string.Concat("CimCmdlet_", containsErrorRecord.ErrorRecord.FullyQualifiedErrorId), containsErrorRecord.ErrorRecord.CategoryInfo.Category, cimResultContext));
                }
            }
            else
            {
                return(ErrorToErrorRecord.CreateFromCimException(context, cimException, cimResultContext));
            }
        }
예제 #15
0
 /// <summary>
 /// <para>
 /// Consume the results of async operations
 /// </para>
 /// </summary>
 /// <param name="asyncResult"></param>
 /// <param name="cimResultContext"></param>
 protected void ConsumeCimInstanceAsync(IObservable<CimInstance> asyncResult,
     CimResultContext cimResultContext)
 {
     ConsumeCimInstanceAsync(asyncResult, false, cimResultContext);
 }
예제 #16
0
 /// <summary>
 /// Construct with an exception object
 /// </summary>
 /// <param name="exception"></param>
 public CimWriteError(Exception exception, InvocationContext context, CimResultContext cimResultContext)
 {
     this.exception = exception;
     this.invocationContext = context;
     this.cimResultContext = cimResultContext;
 }
예제 #17
0
        /// <summary>
        /// Create <see cref="ErrorRecord"/> from <see cref="CimException"/> object.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="cimException"></param>
        /// <param name="cimResultContext">the CimResultContext used to provide ErrorSource, etc. info.</param>
        /// <returns></returns>
        internal static ErrorRecord InitializeErrorRecord(
            InvocationContext context,
            CimException cimException,
            CimResultContext cimResultContext)
        {
            ErrorRecord errorRecord = InitializeErrorRecordCore(
                context,
                exception: cimException,
                errorId: cimException.MessageId ?? "MiClientApiError_" + cimException.NativeErrorCode,
                errorCategory: ConvertCimExceptionToErrorCategory(cimException),
                cimResultContext: cimResultContext);

            if (cimException.ErrorData != null)
            {
                errorRecord.CategoryInfo.TargetName = cimException.ErrorSource;
            }
            return errorRecord;
        }
예제 #18
0
        /// <summary>
        /// <para>
        /// Consume the <see cref="CimMethodResultBase"/> of async operations
        /// </para>
        /// </summary>
        /// <param name="asyncResult"></param>
        /// <param name="className"></param>
        /// <param name="methodName"></param>
        /// <param name="cimResultContext"></param>
        protected void ConsumeCimInvokeMethodResultAsync(
            IObservable<CimMethodResultBase> asyncResult,
            String className,
            String methodName,
            CimResultContext cimResultContext)
        {
            CimMethodResultObserver observer = new CimMethodResultObserver(this.session, asyncResult, cimResultContext)
                {
                    ClassName = className,
                    MethodName = methodName
                };

            observer.OnNewResult += this.ResultEventHandler;
            this.operationID = Interlocked.Increment(ref gOperationCounter);
            this.AddOperation(asyncResult);
            this.CancelOperation = asyncResult.Subscribe(observer);
            this.FireOperationCreatedEvent(this.CancelOperation, asyncResult);
        }
예제 #19
0
 /// <summary>
 /// <para>
 /// Consume the <see cref="CimSubscriptionResult"/> of async operations
 /// </para>
 /// </summary>
 /// <param name="asyncResult"></param>
 /// <param name="cimResultContext"></param>
 protected void ConsumeCimSubscriptionResultAsync(
     IObservable<CimSubscriptionResult> asyncResult,
     CimResultContext cimResultContext)
 {
     CimSubscriptionResultObserver observer = new CimSubscriptionResultObserver(
         this.session, asyncResult, cimResultContext);
     observer.OnNewResult += this.ResultEventHandler;
     this.operationID = Interlocked.Increment(ref gOperationCounter);
     this.AddOperation(asyncResult);
     this.CancelOperation = asyncResult.Subscribe(observer);
     this.FireOperationCreatedEvent(this.CancelOperation, asyncResult);
 }
예제 #20
0
        /// <summary>
        /// <para>
        /// Consume the results of async operations
        /// </para>
        /// </summary>
        /// <param name="asyncResult"></param>
        /// <param name="cimResultContext"></param>
        protected void ConsumeObjectAsync(IObservable<object> asyncResult,
            CimResultContext cimResultContext)
        {
            CimResultObserver<object> observer = new CimResultObserver<object>(
                this.session, asyncResult, cimResultContext);

            observer.OnNewResult += this.ResultEventHandler;
            this.operationID = Interlocked.Increment(ref gOperationCounter);
            this.AddOperation(asyncResult);
            this.CancelOperation = asyncResult.Subscribe(observer);
            DebugHelper.WriteLog("FireOperationCreatedEvent");
            this.FireOperationCreatedEvent(this.CancelOperation, asyncResult);
        }
예제 #21
0
        /// <summary>
        /// <para>
        /// Consume the CimInstance results of async operations.
        /// </para>
        /// </summary>
        /// <param name="asyncResult"></param>
        /// <param name="ignoreResultObjects"></param>
        /// <param name="cimResultContext"></param>
        protected void ConsumeCimInstanceAsync(
            IObservable<CimInstance> asyncResult,
            bool ignoreResultObjects,
            CimResultContext cimResultContext)
        {
            CimResultObserver<CimInstance> observer;
            if (ignoreResultObjects)
            {
                observer = new IgnoreResultObserver(this.session, asyncResult);
            }
            else
            {
                observer = new CimResultObserver<CimInstance>(this.session, asyncResult, cimResultContext);
            }

            observer.OnNewResult += this.ResultEventHandler;
            this.operationID = Interlocked.Increment(ref gOperationCounter);
            this.AddOperation(asyncResult);
            this.CancelOperation = asyncResult.Subscribe(observer);
            this.FireOperationCreatedEvent(this.CancelOperation, asyncResult);
        }
예제 #22
0
 internal static ErrorRecord CreateFromCimException(InvocationContext context, CimException cimException, CimResultContext cimResultContext)
 {
     return(ErrorToErrorRecord.InitializeErrorRecord(context, cimException, cimResultContext));
 }
예제 #23
0
        internal static ErrorRecord InitializeErrorRecord(InvocationContext context, CimException cimException, CimResultContext cimResultContext)
        {
            InvocationContext invocationContext = context;
            CimException      cimException1     = cimException;
            string            messageId         = cimException.MessageId;
            string            str = messageId;

            if (messageId == null)
            {
                str = string.Concat("MiClientApiError_", cimException.NativeErrorCode);
            }
            ErrorRecord errorSource = ErrorToErrorRecord.InitializeErrorRecordCore(invocationContext, cimException1, str, ErrorToErrorRecord.ConvertCimExceptionToErrorCategory(cimException), cimResultContext);

            if (cimException.ErrorData != null)
            {
                errorSource.CategoryInfo.TargetName = cimException.ErrorSource;
            }
            return(errorSource);
        }
예제 #24
0
        /// <summary>
        /// Create <see cref="ErrorRecord"/> from <see cref="Exception"/> object.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="exception"></param>
        /// <param name="errorId"></param>
        /// <param name="errorCategory"></param>
        /// <param name="cimResultContext">the CimResultContext used to provide ErrorSource, etc. info.</param>
        /// <returns></returns>
        internal static ErrorRecord InitializeErrorRecordCore(
            InvocationContext context,
            Exception exception,
            string errorId,
            ErrorCategory errorCategory,
            CimResultContext cimResultContext)
        {
            object theTargetObject = null;
            if (cimResultContext != null)
            {
                theTargetObject = cimResultContext.ErrorSource;
            }
            if (theTargetObject == null)
            {
                if (context != null)
                {
                    if (context.TargetCimInstance != null)
                    {
                        theTargetObject = context.TargetCimInstance;
                    }
                }
            }
            ErrorRecord coreErrorRecord = new ErrorRecord(
                exception: exception,
                errorId: errorId,
                errorCategory: errorCategory,
                targetObject: theTargetObject);

            if (context == null)
            {
                return coreErrorRecord;
            }

            System.Management.Automation.Remoting.OriginInfo originInfo = new System.Management.Automation.Remoting.OriginInfo(
                context.ComputerName,
                Guid.Empty);

            ErrorRecord errorRecord = new System.Management.Automation.Runspaces.RemotingErrorRecord(
                coreErrorRecord,
                originInfo);

            DebugHelper.WriteLogEx("Created RemotingErrorRecord.", 0);
            // errorRecord.SetInvocationInfo(jobContext.CmdletInvocationInfo);
            // errorRecord.PreserveInvocationInfoOnce = true;
            return errorRecord;
        }
예제 #25
0
		protected void ConsumeCimInvokeMethodResultAsync(IObservable<CimMethodResultBase> asyncResult, string className, string methodName, CimResultContext cimResultContext)
		{
			CimMethodResultObserver cimMethodResultObserver = new CimMethodResultObserver(this.session, asyncResult, cimResultContext);
			cimMethodResultObserver.ClassName = className;
			cimMethodResultObserver.MethodName = methodName;
			CimMethodResultObserver cimMethodResultObserver1 = cimMethodResultObserver;
			cimMethodResultObserver1.OnNewResult += new CimResultObserver<CimMethodResultBase>.ResultEventHandler(this.ResultEventHandler);
			this.operationID = Interlocked.Increment(ref CimSessionProxy.gOperationCounter);
			this.AddOperation(asyncResult);
			this.CancelOperation = asyncResult.Subscribe(cimMethodResultObserver1);
			this.FireOperationCreatedEvent(this.CancelOperation, asyncResult);
		}
예제 #26
0
		internal static ErrorRecord CreateFromCimException(InvocationContext context, CimException cimException, CimResultContext cimResultContext)
		{
			return ErrorToErrorRecord.InitializeErrorRecord(context, cimException, cimResultContext);
		}
예제 #27
0
        internal static ErrorRecord InitializeErrorRecordCore(InvocationContext context, Exception exception, string errorId, ErrorCategory errorCategory, CimResultContext cimResultContext)
        {
            object errorSource = null;

            if (cimResultContext != null)
            {
                errorSource = cimResultContext.ErrorSource;
            }
            if (errorSource == null && context != null && context.TargetCimInstance != null)
            {
                errorSource = context.TargetCimInstance;
            }
            ErrorRecord errorRecord = new ErrorRecord(exception, errorId, errorCategory, errorSource);

            if (context != null)
            {
                OriginInfo  originInfo          = new OriginInfo(context.ComputerName, Guid.Empty);
                ErrorRecord remotingErrorRecord = new RemotingErrorRecord(errorRecord, originInfo);
                DebugHelper.WriteLogEx("Created RemotingErrorRecord.", 0);
                return(remotingErrorRecord);
            }
            else
            {
                return(errorRecord);
            }
        }
예제 #28
0
 /// <summary>
 /// Create <see cref="ErrorRecord"/> from <see cref="Exception"/> object.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="exception"></param>
 /// <param name="errorId"></param>
 /// <param name="errorCategory"></param>
 /// <param name="cimResultContext">the CimResultContext used to provide ErrorSource, etc. info.</param>
 /// <returns></returns>
 internal static ErrorRecord InitializeErrorRecord(
     InvocationContext context,
     Exception exception,
     string errorId,
     ErrorCategory errorCategory,
     CimResultContext cimResultContext)
 {
     return InitializeErrorRecordCore(
         context,
         exception: exception,
         errorId: errorId,
         errorCategory: errorCategory,
         cimResultContext: cimResultContext);
 }
예제 #29
0
		internal static ErrorRecord ErrorRecordFromAnyException(InvocationContext context, Exception inner, CimResultContext cimResultContext)
		{
			CimException cimException = inner as CimException;
			if (cimException == null)
			{
				IContainsErrorRecord containsErrorRecord = inner as IContainsErrorRecord;
				if (containsErrorRecord == null)
				{
					return ErrorToErrorRecord.InitializeErrorRecord(context, inner, string.Concat("CimCmdlet_", inner.GetType().Name), ErrorCategory.NotSpecified, cimResultContext);
				}
				else
				{
					return ErrorToErrorRecord.InitializeErrorRecord(context, inner, string.Concat("CimCmdlet_", containsErrorRecord.ErrorRecord.FullyQualifiedErrorId), containsErrorRecord.ErrorRecord.CategoryInfo.Category, cimResultContext);
				}
			}
			else
			{
				return ErrorToErrorRecord.CreateFromCimException(context, cimException, cimResultContext);
			}
		}
예제 #30
0
		internal static ErrorRecord InitializeErrorRecord(InvocationContext context, CimException cimException, CimResultContext cimResultContext)
		{
			InvocationContext invocationContext = context;
			CimException cimException1 = cimException;
			string messageId = cimException.MessageId;
			string str = messageId;
			if (messageId == null)
			{
				str = string.Concat("MiClientApiError_", cimException.NativeErrorCode);
			}
			ErrorRecord errorSource = ErrorToErrorRecord.InitializeErrorRecordCore(invocationContext, cimException1, str, ErrorToErrorRecord.ConvertCimExceptionToErrorCategory(cimException), cimResultContext);
			if (cimException.ErrorData != null)
			{
				errorSource.CategoryInfo.TargetName = cimException.ErrorSource;
			}
			return errorSource;
		}
예제 #31
0
		internal static ErrorRecord InitializeErrorRecordCore(InvocationContext context, Exception exception, string errorId, ErrorCategory errorCategory, CimResultContext cimResultContext)
		{
			object errorSource = null;
			if (cimResultContext != null)
			{
				errorSource = cimResultContext.ErrorSource;
			}
			if (errorSource == null && context != null && context.TargetCimInstance != null)
			{
				errorSource = context.TargetCimInstance;
			}
			ErrorRecord errorRecord = new ErrorRecord(exception, errorId, errorCategory, errorSource);
			if (context != null)
			{
				OriginInfo originInfo = new OriginInfo(context.ComputerName, Guid.Empty);
				ErrorRecord remotingErrorRecord = new RemotingErrorRecord(errorRecord, originInfo);
				DebugHelper.WriteLogEx("Created RemotingErrorRecord.", 0);
				return remotingErrorRecord;
			}
			else
			{
				return errorRecord;
			}
		}
예제 #32
0
		public AsyncResultErrorEventArgs(CimSession session, IObservable<object> observable, Exception error, CimResultContext cimResultContext) : base(session, observable, (AsyncResultType)1, cimResultContext)
		{
			this.error = error;
		}
예제 #33
0
		protected void ConsumeCimClassAsync(IObservable<CimClass> asyncResult, CimResultContext cimResultContext)
		{
			CimResultObserver<CimClass> cimResultObserver = new CimResultObserver<CimClass>(this.session, asyncResult, cimResultContext);
			cimResultObserver.OnNewResult += new CimResultObserver<CimClass>.ResultEventHandler(this.ResultEventHandler);
			this.operationID = Interlocked.Increment(ref CimSessionProxy.gOperationCounter);
			this.AddOperation(asyncResult);
			this.CancelOperation = asyncResult.Subscribe(cimResultObserver);
			this.FireOperationCreatedEvent(this.CancelOperation, asyncResult);
		}