当前位置: 首页>>代码示例>>C#>>正文


C# IWmiInstance.GetProperty方法代码示例

本文整理汇总了C#中IWmiInstance.GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IWmiInstance.GetProperty方法的具体用法?C# IWmiInstance.GetProperty怎么用?C# IWmiInstance.GetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IWmiInstance的用法示例。


在下文中一共展示了IWmiInstance.GetProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1:

        bool IWmiProvider.GetInstance(IWmiInstance instance)
        {
            string serviceRef = instance.GetProperty(AdministrationStrings.Service) as string;
            string endpointRef = instance.GetProperty(AdministrationStrings.Endpoint) as string;

            return !String.IsNullOrEmpty(serviceRef) && !String.IsNullOrEmpty(endpointRef);
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ServiceEndpointAssociationProvider.cs

示例2:

        bool IWmiProvider.GetInstance(IWmiInstance instance)
        {
            Fx.Assert(null != instance, "");
            string serviceRef = instance.GetProperty(AdministrationStrings.Service) as string;
            string appDomainInfoRef = instance.GetProperty(AdministrationStrings.AppDomainInfo) as string;

            return !String.IsNullOrEmpty(serviceRef) && !String.IsNullOrEmpty(appDomainInfoRef);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:ServiceAppDomainAssociationProvider.cs

示例3: FillAppDomainInfo

        bool IWmiProvider.GetInstance(IWmiInstance instance)
        {
            Fx.Assert(null != instance, "");
            bool bFound = false;
            if ((int)instance.GetProperty(AdministrationStrings.ProcessId) == AppDomainInfo.Current.ProcessId
                && String.Equals((string)instance.GetProperty(AdministrationStrings.Name), AppDomainInfo.Current.Name, StringComparison.Ordinal))
            {
                FillAppDomainInfo(instance);
                bFound = true;
            }

            return bFound;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:13,代码来源:AppDomainInstanceProvider.cs

示例4: foreach

        bool IWmiProvider.GetInstance(IWmiInstance instance)
        {
            Fx.Assert(null != instance, "");
            bool bFound = false;
            if ((int)instance.GetProperty(AdministrationStrings.ProcessId) == AppDomainInfo.Current.ProcessId)
            {
                foreach (ServiceInfo info in new ServiceInfoCollection(ManagementExtension.Services))
                {
                    if (String.Equals((string)instance.GetProperty(AdministrationStrings.DistinguishedName), info.DistinguishedName, StringComparison.OrdinalIgnoreCase))
                    {
                        FillServiceInfo(info, instance);
                        bFound = true;
                        break;
                    }
                }
            }

            return bFound;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:19,代码来源:ServiceInstanceProvider.cs

示例5: UpdateContracts

 bool IWmiProvider.GetInstance(IWmiInstance contract)
 {
     bool flag = false;
     if ((((int) contract.GetProperty("ProcessId")) == AppDomainInfo.Current.ProcessId) && (((int) contract.GetProperty("AppDomainId")) == AppDomainInfo.Current.Id))
     {
         ContractDescription description;
         string property = (string) contract.GetProperty("Name");
         UpdateContracts();
         if (knownContracts.TryGetValue(property, out description))
         {
             flag = true;
             FillContract(contract, description);
         }
     }
     return flag;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:ContractInstanceProvider.cs

示例6: FillEndpointInfo

 bool IWmiProvider.GetInstance(IWmiInstance instance)
 {
     bool flag = false;
     if (this.OwnInstance(instance))
     {
         string property = (string) instance.GetProperty("ListenUri");
         string contractName = (string) instance.GetProperty("ContractName");
         System.ServiceModel.Administration.EndpointInfo endpoint = this.FindEndpoint(property, contractName);
         if (endpoint != null)
         {
             FillEndpointInfo(endpoint, instance);
             flag = true;
         }
     }
     return flag;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:EndpointInstanceProvider.cs

示例7: OwnInstance

 private bool OwnInstance(IWmiInstance instance)
 {
     return ((((int) instance.GetProperty("ProcessId")) == AppDomainInfo.Current.ProcessId) && (((int) instance.GetProperty("AppDomainId")) == AppDomainInfo.Current.Id));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:EndpointInstanceProvider.cs

示例8: GetOperationCounterInstanceName

 private string GetOperationCounterInstanceName(string operationName, IWmiInstance endpointInstance)
 {
     string property = (string) endpointInstance.GetProperty("ListenUri");
     string contractName = (string) endpointInstance.GetProperty("ContractName");
     System.ServiceModel.Administration.EndpointInfo info = this.FindEndpoint(property, contractName);
     string str3 = string.Empty;
     if (PerformanceCounters.PerformanceCountersEnabled && (info != null))
     {
         str3 = OperationPerformanceCountersBase.CreateFriendlyInstanceName(info.ServiceName, info.Contract.Name, operationName, info.Address.AbsoluteUri.ToUpperInvariant());
     }
     return str3;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:EndpointInstanceProvider.cs

示例9: OwnInstance

 bool OwnInstance(IWmiInstance instance)
 {
     return (int)instance.GetProperty(AdministrationStrings.ProcessId) == AppDomainInfo.Current.ProcessId
         && (int)instance.GetProperty(AdministrationStrings.AppDomainId) == AppDomainInfo.Current.Id;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:5,代码来源:EndpointInstanceProvider.cs

示例10: GetOperationCounterInstanceName

        string GetOperationCounterInstanceName(string operationName, IWmiInstance endpointInstance)
        {
            Fx.Assert(null != endpointInstance, "");
            string address = (string)endpointInstance.GetProperty(AdministrationStrings.ListenUri);
            string contractName = (string)endpointInstance.GetProperty(AdministrationStrings.ContractName);
            EndpointInfo endpointInfo = FindEndpoint(address, contractName);

            string result = String.Empty;

            if (PerformanceCounters.PerformanceCountersEnabled && null != endpointInfo)
            {
                result = OperationPerformanceCounters.CreateFriendlyInstanceName(endpointInfo.ServiceName, endpointInfo.Contract.Name, operationName, endpointInfo.Address.AbsoluteUri.ToUpperInvariant());
            }

            return result;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:16,代码来源:EndpointInstanceProvider.cs

示例11: FindEndpoint

        bool IWmiProvider.GetInstance(IWmiInstance instance)
        {
            Fx.Assert(null != instance, "");
            bool bFound = false;
            if (OwnInstance(instance))
            {
                string address = (string)instance.GetProperty(AdministrationStrings.ListenUri);
                string contractName = (string)instance.GetProperty(AdministrationStrings.ContractName);
                EndpointInfo endpointInfo = FindEndpoint(address, contractName);

                if (null != endpointInfo)
                {
                    FillEndpointInfo(endpointInfo, instance);
                    bFound = true;
                }
            }

            return bFound;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:19,代码来源:EndpointInstanceProvider.cs

示例12: return

 bool IWmiProvider.GetInstance(IWmiInstance instance)
 {
     string property = instance.GetProperty("Service") as string;
     string str2 = instance.GetProperty("Endpoint") as string;
     return (!string.IsNullOrEmpty(property) && !string.IsNullOrEmpty(str2));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:6,代码来源:ServiceEndpointAssociationProvider.cs

示例13: WmiPutTraceRecord

        bool IWmiProvider.PutInstance(IWmiInstance instance)
        {
            Fx.Assert(null != instance, "");
            bool bFound = false;
            if ((int)instance.GetProperty(AdministrationStrings.ProcessId) == AppDomainInfo.Current.ProcessId
                && String.Equals((string)instance.GetProperty(AdministrationStrings.Name), AppDomainInfo.Current.Name, StringComparison.Ordinal))
            {
                try
                {
                    SourceLevels newLevel = (SourceLevels)Enum.Parse(typeof(SourceLevels), (string)instance.GetProperty(AdministrationStrings.TraceLevel));
                    if (DiagnosticUtility.Level != newLevel)
                    {
                        if (DiagnosticUtility.ShouldTraceVerbose)
                        {
                            TraceUtility.TraceEvent(TraceEventType.Verbose, TraceCode.WmiPut, SR.GetString(SR.TraceCodeWmiPut),
                                new WmiPutTraceRecord("DiagnosticTrace.Level",
                                DiagnosticUtility.Level,
                                newLevel), instance, null);
                        }
                        DiagnosticUtility.Level = newLevel;
                    }

                    bool logMalformedMessages = (bool)instance.GetProperty(AdministrationStrings.LogMalformedMessages);
                    if (MessageLogger.LogMalformedMessages != logMalformedMessages)
                    {
                        if (DiagnosticUtility.ShouldTraceVerbose)
                        {
                            TraceUtility.TraceEvent(TraceEventType.Verbose, TraceCode.WmiPut, SR.GetString(SR.TraceCodeWmiPut),
                                new WmiPutTraceRecord("MessageLogger.LogMalformedMessages",
                                MessageLogger.LogMalformedMessages,
                                logMalformedMessages), instance, null);
                        }
                        MessageLogger.LogMalformedMessages = logMalformedMessages;
                    }

                    bool logMessagesAtServiceLevel = (bool)instance.GetProperty(AdministrationStrings.LogMessagesAtServiceLevel);
                    if (MessageLogger.LogMessagesAtServiceLevel != logMessagesAtServiceLevel)
                    {
                        if (DiagnosticUtility.ShouldTraceVerbose)
                        {
                            TraceUtility.TraceEvent(TraceEventType.Verbose, TraceCode.WmiPut, SR.GetString(SR.TraceCodeWmiPut),
                                new WmiPutTraceRecord("MessageLogger.LogMessagesAtServiceLevel",
                                MessageLogger.LogMessagesAtServiceLevel,
                                logMessagesAtServiceLevel), instance, null);
                        }
                        MessageLogger.LogMessagesAtServiceLevel = logMessagesAtServiceLevel;
                    }

                    bool logMessagesAtTransportLevel = (bool)instance.GetProperty(AdministrationStrings.LogMessagesAtTransportLevel);
                    if (MessageLogger.LogMessagesAtTransportLevel != logMessagesAtTransportLevel)
                    {
                        if (DiagnosticUtility.ShouldTraceVerbose)
                        {
                            TraceUtility.TraceEvent(TraceEventType.Verbose, TraceCode.WmiPut, SR.GetString(SR.TraceCodeWmiPut),
                                new WmiPutTraceRecord("MessageLogger.LogMessagesAtTransportLevel",
                                MessageLogger.LogMessagesAtTransportLevel,
                                logMessagesAtTransportLevel), instance, null);
                        }
                        MessageLogger.LogMessagesAtTransportLevel = logMessagesAtTransportLevel;
                    }
                }
                catch (ArgumentException)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemInvalidParameterException());
                }
                bFound = true;
            }

            return bFound;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:70,代码来源:AppDomainInstanceProvider.cs

示例14: foreach

 bool IWmiProvider.GetInstance(IWmiInstance instance)
 {
     if (((int) instance.GetProperty("ProcessId")) == AppDomainInfo.Current.ProcessId)
     {
         foreach (ServiceInfo info in new ServiceInfoCollection(ManagementExtension.Services))
         {
             if (string.Equals((string) instance.GetProperty("DistinguishedName"), info.DistinguishedName, StringComparison.OrdinalIgnoreCase))
             {
                 this.FillServiceInfo(info, instance);
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:ServiceInstanceProvider.cs

示例15: UpdateContracts

        bool IWmiProvider.GetInstance(IWmiInstance contract)
        {
            Fx.Assert(null != contract, "");
            bool bFound = false;
            if ((int)contract.GetProperty(AdministrationStrings.ProcessId) == AppDomainInfo.Current.ProcessId
                && (int)contract.GetProperty(AdministrationStrings.AppDomainId) == AppDomainInfo.Current.Id)
            {
                string contractName = (string)contract.GetProperty(AdministrationStrings.Name);

                ContractDescription contractDescription;
                UpdateContracts();
                if (ContractInstanceProvider.knownContracts.TryGetValue(contractName, out contractDescription))
                {
                    bFound = true;
                    FillContract(contract, contractDescription);
                }
            }

            return bFound;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:20,代码来源:ContractInstanceProvider.cs


注:本文中的IWmiInstance.GetProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。