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


C# ManagementScope.Clone方法代码示例

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


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

示例1: WmiEventSink

 protected WmiEventSink(ManagementOperationObserver watcher, object context, ManagementScope scope, string path, string className)
 {
     try
     {
         this.context = context;
         this.watcher = watcher;
         this.className = className;
         this.isLocal = false;
         if (path != null)
         {
             this.path = new ManagementPath(path);
             if ((string.Compare(this.path.Server, ".", StringComparison.OrdinalIgnoreCase) == 0) || (string.Compare(this.path.Server, Environment.MachineName, StringComparison.OrdinalIgnoreCase) == 0))
             {
                 this.isLocal = true;
             }
         }
         if (scope != null)
         {
             this.scope = scope.Clone();
             if ((path == null) && ((string.Compare(this.scope.Path.Server, ".", StringComparison.OrdinalIgnoreCase) == 0) || (string.Compare(this.scope.Path.Server, Environment.MachineName, StringComparison.OrdinalIgnoreCase) == 0)))
             {
                 this.isLocal = true;
             }
         }
         WmiNetUtilsHelper.GetDemultiplexedStub_f(this, this.isLocal, out this.stub);
         this.hash = Interlocked.Increment(ref s_hash);
     }
     catch
     {
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:WmiEventSink.cs

示例2: ManagementObjectCollection

 internal ManagementObjectCollection(ManagementScope scope, EnumerationOptions options, IEnumWbemClassObject enumWbem)
 {
     if (options != null)
     {
         this.options = (EnumerationOptions) options.Clone();
     }
     else
     {
         this.options = new EnumerationOptions();
     }
     if (scope != null)
     {
         this.scope = scope.Clone();
     }
     else
     {
         this.scope = ManagementScope._Clone(null);
     }
     this.enumWbem = enumWbem;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:ManagementObjectCollection.cs

示例3: Provider

 /// <summary>
 /// Connect to a given ManagementScope.
 /// </summary>
 /// <param name="mScope">ManagementScope object to be connected to.</param>
 public Provider(ManagementScope mScope)
 {
     mScope = mScope.Clone();
 }
开发者ID:przemo098,项目名称:ccmmanager,代码行数:8,代码来源:Provider.cs

示例4: ManagementObjectCollection

        //internal IWbemServices GetIWbemServices () {
        //  return scope.GetIWbemServices ();
        //}

        //internal ConnectionOptions Connection {
        //  get { return scope.Connection; }
        //}

        //Constructor
        internal ManagementObjectCollection(
            ManagementScope scope,
            EnumerationOptions options, 
            IEnumWbemClassObject enumWbem)
        {
            if (null != options)
                this.options = (EnumerationOptions) options.Clone();
            else
                this.options = new EnumerationOptions ();

            if (null != scope)
                this.scope = (ManagementScope)scope.Clone ();
            else
                this.scope = ManagementScope._Clone(null);

            this.enumWbem = enumWbem;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:26,代码来源:ManagementObjectCollection.cs


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