Ejemplo n.º 1
0
        internal MI_Result SetString(
            string optionName,
            string value,
            MI_OperationOptionsFlags flags
            )
        {
            MI_Result resultLocal = this.ft.SetString(this,
                                                      optionName,
                                                      value,
                                                      flags);

            return(resultLocal);
        }
Ejemplo n.º 2
0
        internal MI_Result SetInterval(
            string optionName,
            MI_Interval value,
            MI_OperationOptionsFlags flags
            )
        {
            MI_Result resultLocal = this.ft.SetInterval(this,
                                                        optionName,
                                                        ref value,
                                                        flags);

            return(resultLocal);
        }
Ejemplo n.º 3
0
        internal MI_Result SetNumber(
            string optionName,
            UInt32 value,
            MI_OperationOptionsFlags flags
            )
        {
            MI_Result resultLocal = this.ft.SetNumber(this,
                                                      optionName,
                                                      value,
                                                      flags);

            return(resultLocal);
        }
Ejemplo n.º 4
0
        internal MI_Result GetNumber(
            string optionName,
            out UInt32 value,
            out UInt32 index,
            out MI_OperationOptionsFlags flags
            )
        {
            MI_Result resultLocal = this.ft.GetNumber(this,
                                                      optionName,
                                                      out value,
                                                      out index,
                                                      out flags);

            return(resultLocal);
        }
Ejemplo n.º 5
0
        internal MI_Result GetInterval(
            string optionName,
            out MI_Interval value,
            out UInt32 index,
            out MI_OperationOptionsFlags flags
            )
        {
            MI_Interval valueLocal  = new MI_Interval();
            MI_Result   resultLocal = this.ft.GetInterval(this,
                                                          optionName,
                                                          ref valueLocal,
                                                          out index,
                                                          out flags);

            value = valueLocal;
            return(resultLocal);
        }
Ejemplo n.º 6
0
        internal MI_Result GetEnabledChannels(
            string optionName,
            out UInt32 channels,
            UInt32 bufferLength,
            out UInt32 channelCount,
            out MI_OperationOptionsFlags flags
            )
        {
            MI_Result resultLocal = this.ft.GetEnabledChannels(this,
                                                               optionName,
                                                               out channels,
                                                               bufferLength,
                                                               out channelCount,
                                                               out flags);

            return(resultLocal);
        }
Ejemplo n.º 7
0
        internal MI_Result GetOption(
            string optionName,
            MI_Value value,
            out MI_Type type,
            out UInt32 index,
            out MI_OperationOptionsFlags flags
            )
        {
            MI_Result resultLocal = this.ft.GetOption(this,
                                                      optionName,
                                                      value,
                                                      out type,
                                                      out index,
                                                      out flags);

            return(resultLocal);
        }
Ejemplo n.º 8
0
        internal MI_Result SetCustomOption(
            string optionName,
            MI_Type valueType,
            MI_Value value,
            bool mustComply,
            MI_OperationOptionsFlags flags
            )
        {
            MI_Result resultLocal = this.ft.SetCustomOption(this,
                                                            optionName,
                                                            valueType,
                                                            value,
                                                            mustComply,
                                                            flags);

            return(resultLocal);
        }
Ejemplo n.º 9
0
        internal MI_Result GetString(
            string optionName,
            out string value,
            out UInt32 index,
            out MI_OperationOptionsFlags flags
            )
        {
            MI_String valueLocal = MI_String.NewIndirectPtr();

            MI_Result resultLocal = this.ft.GetString(this,
                                                      optionName,
                                                      valueLocal,
                                                      out index,
                                                      out flags);

            value = valueLocal.Value;
            return(resultLocal);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Sets a custom server or CIM provider option
        /// </summary>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="optionName"/> is <c>null</c></exception>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="optionName"/> or <paramref name="optionValue"/> is <c>null</c></exception>
        public void SetCustomOption(string optionName, object optionValue, CimType cimType, bool mustComply)
        {
            if (string.IsNullOrWhiteSpace(optionName))
            {
                throw new ArgumentNullException("optionName");
            }
            if (optionValue == null)
            {
                throw new ArgumentNullException("optionValue");
            }
            this.AssertNotDisposed();

            MI_Value nativeLayerValue;

            try
            {
                nativeLayerValue = ValueHelpers.ConvertToNativeLayer(optionValue, cimType);
                ValueHelpers.ThrowIfMismatchedType(cimType.FromCimType(), nativeLayerValue);
            }
            catch (InvalidCastException e)
            {
                throw new ArgumentException(e.Message, "optionValue", e);
            }
            catch (FormatException e)
            {
                throw new ArgumentException(e.Message, "optionValue", e);
            }
            catch (ArgumentException e)
            {
                throw new ArgumentException(e.Message, "optionValue", e);
            }

            MI_OperationOptionsFlags flags = MI_OperationOptionsFlags.Unused;
            MI_Result result = this.OperationOptionsHandleOnDemand.SetCustomOption(
                optionName,
                cimType.FromCimType(),
                nativeLayerValue,
                mustComply,
                flags);

            CimException.ThrowIfMiResultFailure(result);
        }
Ejemplo n.º 11
0
        internal MI_Result GetOptionAt(
            UInt32 index,
            out string optionName,
            MI_Value value,
            out MI_Type type,
            out MI_OperationOptionsFlags flags
            )
        {
            MI_String optionNameLocal = MI_String.NewIndirectPtr();

            MI_Result resultLocal = this.ft.GetOptionAt(this,
                                                        index,
                                                        optionNameLocal,
                                                        value,
                                                        out type,
                                                        out flags);

            optionName = optionNameLocal.Value;
            return(resultLocal);
        }