예제 #1
0
 public static CimMethodParameter Create(string name, object value, CimFlags flags)
 {
     Microsoft.Management.Infrastructure.CimType cimTypeFromDotNetValueOrThrowAnException = CimConverter.GetCimTypeFromDotNetValueOrThrowAnException(value);
     return(Create(name, value, cimTypeFromDotNetValueOrThrowAnException, flags));
 }
예제 #2
0
        /// <summary>
        /// Creates a new property.
        /// This method overload tries to infer <see cref="CimType"/> from the property <paramref name="value"/>
        /// </summary>
        /// <param name="name">Name of the property</param>
        /// <param name="value">Value of the property.  <c>null</c> is the property doesn't have an associated value.</param>
        /// <param name="flags"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="name"/> is null</exception>
        /// <exception cref="ArgumentException">Thrown when the <see cref="CimType"/> cannot be inferred from the property <paramref name="value"/> </exception>
        static public CimProperty Create(string name, object value, CimFlags flags)
        {
            CimType cimType = CimConverter.GetCimTypeFromDotNetValueOrThrowAnException(value);

            return(Create(name, value, cimType, flags));
        }