internal WbemInstance(WbemProvider.ParameterContext parms, WbemProvider.ObjectPathRegex objPathRegex) : this(parms, objPathRegex.ClassName)
 {
     foreach (KeyValuePair <string, object> pair in objPathRegex.Keys)
     {
         this.SetProperty(pair.Key, pair.Value);
     }
 }
 internal MethodContext(WbemProvider.ParameterContext parms, string methodName, WbemNative.IWbemClassObject wbemInParms, WbemProvider.WbemInstance wbemInstance)
 {
     this.parms       = parms;
     this.methodName  = methodName;
     this.wbemInParms = wbemInParms;
     this.instance    = new WbemProvider.InstanceContext(wbemInstance);
     WbemNative.IWbemClassObject ppObject = null;
     WbemException.ThrowIfFail(parms.WbemServices.GetObject(parms.ClassName, 0, parms.WbemContext, ref ppObject, IntPtr.Zero));
     WbemNative.IWbemClassObject ppOutSignature = null;
     WbemException.ThrowIfFail(ppObject.GetMethod(methodName, 0, IntPtr.Zero, out ppOutSignature));
     WbemException.ThrowIfFail(ppOutSignature.SpawnInstance(0, out this.wbemOutParms));
 }
 internal WbemInstance(WbemProvider.ParameterContext parms, string className)
 {
     this.parms = parms;
     if (string.IsNullOrEmpty(className))
     {
         className = parms.ClassName;
     }
     this.className = className;
     WbemNative.IWbemClassObject ppObject = null;
     WbemException.ThrowIfFail(parms.WbemServices.GetObject(className, 0, parms.WbemContext, ref ppObject, IntPtr.Zero));
     if (ppObject != null)
     {
         WbemException.ThrowIfFail(ppObject.SpawnInstance(0, out this.wbemObject));
     }
 }
 internal WbemInstance(WbemProvider.ParameterContext parms, string className)
 {
     this.parms = parms;
     if (string.IsNullOrEmpty(className))
     {
         className = parms.ClassName;
     }
     this.className = className;
     WbemNative.IWbemClassObject ppObject = null;
     WbemException.ThrowIfFail(parms.WbemServices.GetObject(className, 0, parms.WbemContext, ref ppObject, IntPtr.Zero));
     if (ppObject != null)
     {
         WbemException.ThrowIfFail(ppObject.SpawnInstance(0, out this.wbemObject));
     }
 }
 internal WbemInstance(WbemProvider.ParameterContext parms, WbemNative.IWbemClassObject wbemObject)
 {
     this.parms = parms;
     this.wbemObject = wbemObject;
 }
 internal MethodContext(WbemProvider.ParameterContext parms, string methodName, WbemNative.IWbemClassObject wbemInParms, WbemProvider.WbemInstance wbemInstance)
 {
     this.parms = parms;
     this.methodName = methodName;
     this.wbemInParms = wbemInParms;
     this.instance = new WbemProvider.InstanceContext(wbemInstance);
     WbemNative.IWbemClassObject ppObject = null;
     WbemException.ThrowIfFail(parms.WbemServices.GetObject(parms.ClassName, 0, parms.WbemContext, ref ppObject, IntPtr.Zero));
     WbemNative.IWbemClassObject ppOutSignature = null;
     WbemException.ThrowIfFail(ppObject.GetMethod(methodName, 0, IntPtr.Zero, out ppOutSignature));
     WbemException.ThrowIfFail(ppOutSignature.SpawnInstance(0, out this.wbemOutParms));
 }
 internal InstancesContext(WbemProvider.ParameterContext parms)
 {
     this.parms = parms;
 }
 internal WbemInstance(WbemProvider.ParameterContext parms, WbemNative.IWbemClassObject wbemObject)
 {
     this.parms      = parms;
     this.wbemObject = wbemObject;
 }
 internal InstancesContext(WbemProvider.ParameterContext parms)
 {
     this.parms = parms;
 }