本文整理汇总了C#中System.Management.ManagementClass.CompareTo方法的典型用法代码示例。如果您正苦于以下问题:C# ManagementClass.CompareTo方法的具体用法?C# ManagementClass.CompareTo怎么用?C# ManagementClass.CompareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Management.ManagementClass
的用法示例。
在下文中一共展示了ManagementClass.CompareTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsClassAlreadyPresentInRepository
private bool IsClassAlreadyPresentInRepository(ManagementObject obj)
{
bool flag = false;
string str = SchemaNaming.MakeClassPath(this.NamespaceName, (string)obj.SystemProperties["__CLASS"].Value);
if (SchemaNaming.DoesClassExist(str))
{
ManagementObject managementClass = new ManagementClass(str);
flag = managementClass.CompareTo(obj, ComparisonSettings.IgnoreObjectSource | ComparisonSettings.IgnoreCase);
}
return flag;
}
示例2: IsClassAlreadyPresentInRepository
// function to check if the class to be added to MOF is already present in repository
// [[....]] VSUQFE#2248 (VSWhidbey 231885)
bool IsClassAlreadyPresentInRepository(ManagementObject obj)
{
bool bRet = false;
string ClassPathInRepository = MakeClassPath(NamespaceName, (string)obj.SystemProperties["__CLASS"].Value);
if (DoesClassExist(ClassPathInRepository))
{
ManagementObject inst = new ManagementClass(ClassPathInRepository);
bRet = inst.CompareTo(obj, ComparisonSettings.IgnoreCase | ComparisonSettings.IgnoreObjectSource);
}
return bRet;
}