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


C# String.ToLowerInvariant方法代码示例

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


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

示例1: ManagementQueryBroker

        /// <summary>
        /// Creates a new instance of System.Management.ManagementQueryBroker.
        /// </summary>
        /// <param name="query">The WQL Query to be executed.</param>
        /// <param name="namespacePath">Namespace path of the ManagementPath within which to execute a query.</param>
        /// <param name="connectionOptions">Specifies all settings required to make a WMI connection.</param>
        public ManagementQueryBroker(String query, ManagementScope scope)
        {
            this.Query = query;
            this.scope = scope;
            this.QueryType = query.GetWqlQueryType();
            this.Results = new List<ManagementBaseObject>();

            this.queryObserver = new ManagementOperationObserver();
            this.queryObserver.ObjectReady += new ObjectReadyEventHandler(queryObserver_ObjectReady);
            this.queryObserver.Completed += new CompletedEventHandler(queryObserver_Completed);

            // Extract class name from query
            MatchCollection matches = Regex.Matches(query, @"(select.*from\s+|references\s+of\s+{|associators\s+of\s+{)([A-Za-z0-9_]+)", RegexOptions.IgnoreCase);
            if (matches.Count != 1 || !matches[0].Groups[2].Success)
                throw new ArgumentException("Could not determine class name from query.");

            // Get class descriptor to assist with queries
            var options = new ObjectGetOptions();
            options.UseAmendedQualifiers = true;

            var className = matches[0].Groups[2];
            var classPath = new ManagementPath(String.Format("\\\\{0}\\{1}:{2}", scope.Path.Server, scope.Path.NamespacePath, className));
            this.ResultClass = new ManagementClass(this.scope, classPath, options);

            // Configure event queries
            this.IsEventQuery = this.ResultClass.IsEvent();
            if (this.IsEventQuery && query.ToLowerInvariant().Contains("group within"))
            {
                // Change result class to '__AggregateEvent' if this is an event query with a grouping
                classPath = new ManagementPath(String.Format("\\\\{0}\\{1}:__AggregateEvent", scope.Path.Server, scope.Path.NamespacePath));
                this.ResultClass = new ManagementClass(this.scope, classPath, new ObjectGetOptions());
            }

            // Get value maps for the query
            this.ResultClassValueMaps = this.ResultClass.GetValueMaps();
        }
开发者ID:giapdangle,项目名称:wmilab,代码行数:42,代码来源:ManagementQueryBroker.cs


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