//Constructor
 internal ManagementBaseObject(IWbemClassObjectFreeThreaded wbemObject)
 {
     this.wbemObject  = wbemObject;
     properties       = null;
     systemProperties = null;
     qualifiers       = null;
 }
Beispiel #2
0
 internal PropertyData(ManagementBaseObject parent, string propName)
 {
     this.parent       = parent;
     this.propertyName = propName;
     qualifiers        = null;
     RefreshPropertyInfo();
 }
 internal ManagementBaseObject(IWbemClassObjectFreeThreaded wbemObject)
 {
     this.wbemObject = wbemObject;
     this.properties = null;
     this.systemProperties = null;
     this.qualifiers = null;
 }
 internal MethodData(ManagementObject parent, string methodName)
 {
     this.parent = parent;
     this.methodName = methodName;
     this.RefreshMethodInfo();
     this.qualifiers = null;
 }
Beispiel #5
0
 internal MethodData(ManagementObject parent, string methodName)
 {
     this.parent     = parent;
     this.methodName = methodName;
     RefreshMethodInfo();
     qualifiers = null;
 }
 internal PropertyData(ManagementBaseObject parent, string propName)
 {
     this.parent = parent;
     this.propertyName = propName;
     this.qualifiers = null;
     this.RefreshPropertyInfo();
 }
 protected ManagementBaseObject(SerializationInfo info, StreamingContext context)
 {
     this._wbemObject = info.GetValue("wbemObject", typeof(IWbemClassObjectFreeThreaded)) as IWbemClassObjectFreeThreaded;
     if (this._wbemObject == null)
     {
         throw new SerializationException();
     }
     this.properties = null;
     this.systemProperties = null;
     this.qualifiers = null;
 }
Beispiel #8
0
 /// <summary>
 /// <para>Initializes a new instance of the <see cref='System.Management.ManagementBaseObject'/> class that is serializable.</para>
 /// </summary>
 /// <param name='info'>The <see cref='System.Runtime.Serialization.SerializationInfo'/> to populate with data.</param>
 /// <param name='context'>The destination (see <see cref='System.Runtime.Serialization.StreamingContext'/> ) for this serialization.</param>
 protected ManagementBaseObject(SerializationInfo info, StreamingContext context)
 {
     wbemObject = info.GetValue("wbemObject", typeof(IWbemClassObjectFreeThreaded)) as IWbemClassObjectFreeThreaded;
     if (null == wbemObject)
     {
         throw new SerializationException();
     }
     properties       = null;
     systemProperties = null;
     qualifiers       = null;
 }
Beispiel #9
0
        public static Boolean Exists(this QualifierDataCollection qualifiers, string qualifier)
        {
            foreach (QualifierData q in qualifiers)
            {
                if (q.Name.Equals(qualifier, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(true);
                }
            }

            return(false);
        }
 protected ManagementBaseObject(SerializationInfo info, StreamingContext context)
 {
     this._wbemObject = info.GetValue("wbemObject", typeof(IWbemClassObjectFreeThreaded)) as IWbemClassObjectFreeThreaded;
     if (this._wbemObject != null)
     {
         this.properties       = null;
         this.systemProperties = null;
         this.qualifiers       = null;
         return;
     }
     else
     {
         throw new SerializationException();
     }
 }
Beispiel #11
0
		static string Serialize (QualifierDataCollection properties)
		{
			NativeCimQualifiers obj = new NativeCimQualifiers();
			foreach (var q in properties) {
				obj.Add(q.Name, q.IsAmended, q.IsLocal, q.IsOverridable, q.PropagatesToInstance, q.PropagatesToSubclass, q.Value);
			}
			return NativeCimQualifiersHelper.Serialize (obj);
		}
Beispiel #12
0
        private String GetQualiferDeclaration(QualifierDataCollection qualifiers)
        {
            if (qualifiers.Count == 0)
                return String.Empty;

            int i = 0;
            var sb = new StringBuilder();
            sb.Append("[");

            int count = 0;
            foreach (var qualifier in qualifiers)
                if (IncludeQualifier(qualifier))
                    count++;

            foreach (QualifierData qualifier in qualifiers)
            {
                if (IncludeQualifier(qualifier))
                {
                    sb.Append(qualifier.Name);

                    // Append qualifer value
                    if (qualifier.Value != null)
                    {
                        if (qualifier.Value.GetType() == typeof(Boolean))
                        {
                            if (qualifier.Value == (Object)false)
                                sb.Append("(FALSE)");
                        }

                        else if (qualifier.Value.GetType().IsNumeric())
                        {
                            sb.AppendFormat(@"({0})", qualifier.Value);
                        }

                        else
                        {
                            sb.Append(GetQualifierStringValue(qualifier, 0));
                        }
                    }

                    if (i < (count - 1))
                        sb.Append(",\r\n ");;

                    i++;
                }
            }

            sb.Append("]");
            return sb.ToString();
        }
Beispiel #13
0
 private static void PrintPropertyQualifiers(QualifierDataCollection qualifiers)
 {
     if (!_showPropQualifiers) return;
     foreach (var qual in qualifiers)
     {
         Console.WriteLine("\t\t\tQUALIFIER: Name[{3}]  IsAmended[{0}] IsLocal[{1}] IsOverridable[{2}] PropagatesToInstance[{4}] PropagatesToSubclass[{5}]", qual.IsAmended, qual.IsLocal, qual.IsOverridable, qual.Name, qual.PropagatesToInstance, qual.PropagatesToSubclass);
         Console.WriteLine("\t\t\t    VALUE: {0}", qual.Value);
     }
 }