本文整理汇总了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
{
}
}
示例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();
}
示例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;
}