public override void RegisterAcceptedAsyncCallbacks(MI_OperationCallbacks operationCallbacks, CimOperationOptions operationOptions)
 {
     base.RegisterAcceptedAsyncCallbacks(operationCallbacks, operationOptions);
     // TODO: Uncomment and fix below
     //operationCallbacks.instanceResult = this.InstanceResultCallback;
     if ((operationOptions != null) && (operationOptions.EnableMethodResultStreaming))
     {
         // TODO: Uncomment and fix below
         //operationCallbacks.streamedParameterResult = this.StreamedParameterCallback;
     }
 }
Ejemplo n.º 2
0
        static internal MI_OperationCallbacks GetOperationCallbacks(
            this CimOperationOptions operationOptions,
            CimAsyncCallbacksReceiverBase acceptCallbacksReceiver)
        {
            MI_OperationCallbacks operationCallbacks = operationOptions.GetOperationCallbacks();

            if (acceptCallbacksReceiver != null)
            {
                acceptCallbacksReceiver.RegisterAcceptedAsyncCallbacks(operationCallbacks, operationOptions);
            }

            return(operationCallbacks);
        }
Ejemplo n.º 3
0
        static internal MI_OperationCallbacks GetOperationCallbacks(this CimOperationOptions operationOptions)
        {
            var operationCallbacks = new MI_OperationCallbacks();

            if (operationOptions != null)
            {
                // TODO: Uncomment these
                //operationCallbacks.writeError = operationOptions.OperationCallback.WriteErrorCallback;
                //operationCallbacks.writeMessage = operationOptions.OperationCallback.WriteMessageCallback;
                //operationCallbacks.writeProgress = operationOptions.OperationCallback.WriteProgressCallback;
                //operationCallbacks.promptUser = operationOptions.OperationCallback.PromptUserCallback;
            }
            return(operationCallbacks);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new <see cref="CimOperationOptions"/> instance.
        /// </summary>
        /// <param name="mustUnderstand">Indicates whether the server has to understand all the options.</param>
        public CimOperationOptions(bool mustUnderstand)
        {
            var operationCallbacks = new MI_OperationCallbacks();

            this._operationCallback      = operationCallbacks;
            _writeMessageCallback        = null;
            _writeProgressCallback       = null;
            _writeErrorCallback          = null;
            _promptUserCallback          = null;
            this._operationOptionsHandle = new Lazy <MI_OperationOptions>(
                delegate
            {
                MI_OperationOptions operationOptionsHandle;
                MI_Result result = CimApplication.Handle.NewOperationOptions(
                    mustUnderstand, out operationOptionsHandle);
                CimException.ThrowIfMiResultFailure(result);
                return(operationOptionsHandle);
            });
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Instantiates a deep copy of <paramref name="optionsToClone"/>
        /// </summary>
        /// <param name="optionsToClone">options to clone</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="optionsToClone"/> is <c>null</c></exception>
        public CimOperationOptions(CimOperationOptions optionsToClone)
        {
            if (optionsToClone == null)
            {
                throw new ArgumentNullException("optionsToClone");
            }

            this._operationCallback      = optionsToClone.GetOperationCallbacks();
            _writeMessageCallback        = optionsToClone._writeMessageCallback;
            _writeProgressCallback       = optionsToClone._writeProgressCallback;
            _writeErrorCallback          = optionsToClone._writeErrorCallback;
            _promptUserCallback          = optionsToClone._promptUserCallback;
            this._operationOptionsHandle = new Lazy <MI_OperationOptions>(
                delegate
            {
                MI_OperationOptions tmp;
                MI_Result result = optionsToClone.OperationOptionsHandle.Clone(out tmp);
                CimException.ThrowIfMiResultFailure(result);
                return(tmp);
            });
        }
 public virtual void RegisterAcceptedAsyncCallbacks(MI_OperationCallbacks operationCallbacks, CimOperationOptions operationOptions)
 {
     // TODO: Uncomment and fix two lines below
     //operationCallbacks.InternalErrorCallback = this.ReportInternalErrorCore;
     //operationCallbacks.ManagedOperationContext = this;
 }
Ejemplo n.º 7
0
 public override void RegisterAcceptedAsyncCallbacks(MI_OperationCallbacks operationCallbacks, CimOperationOptions operationOptions)
 {
     base.RegisterAcceptedAsyncCallbacks(operationCallbacks, operationOptions);
     // TODO: Uncomment and fix below
     //operationCallbacks.classResult = this.ClassCallback;
 }