private static void Activate() { WbemProvider provider = new WbemProvider(@"root\ServiceModel", "ServiceModel"); provider.Register("AppDomainInfo", new AppDomainInstanceProvider()); provider.Register("Service", new ServiceInstanceProvider()); provider.Register("Contract", new ContractInstanceProvider()); provider.Register("Endpoint", new EndpointInstanceProvider()); provider.Register("ServiceAppDomain", new ServiceAppDomainAssociationProvider()); provider.Register("ServiceToEndpointAssociation", new ServiceEndpointAssociationProvider()); }
static void Activate() { WbemProvider wmi = new WbemProvider(AdministrationStrings.IndigoNamespace, AdministrationStrings.IndigoAppName); wmi.Register(AdministrationStrings.AppDomainInfo, new AppDomainInstanceProvider()); wmi.Register(AdministrationStrings.Service, new ServiceInstanceProvider()); wmi.Register(AdministrationStrings.Contract, new ContractInstanceProvider()); wmi.Register(AdministrationStrings.Endpoint, new EndpointInstanceProvider()); wmi.Register(AdministrationStrings.ServiceAppDomain, new ServiceAppDomainAssociationProvider()); wmi.Register(AdministrationStrings.ServiceToEndpointAssociation, new ServiceEndpointAssociationProvider()); }
internal WbemInstance(WbemProvider.WbemInstance wbemInstance, string className) : this(wbemInstance.parms, className) { }
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, WbemProvider.ObjectPathRegex objPathRegex) : this(parms, objPathRegex.ClassName) { foreach (KeyValuePair<string, object> pair in objPathRegex.Keys) { this.SetProperty(pair.Key, pair.Value); } }
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 InstanceContext(WbemProvider.WbemInstance wbemInstance) { this.wbemInstance = wbemInstance; }