本文整理汇总了C#中Mono.Cecil.TypeDefinition.TypeOrBaseImplements方法的典型用法代码示例。如果您正苦于以下问题:C# TypeDefinition.TypeOrBaseImplements方法的具体用法?C# TypeDefinition.TypeOrBaseImplements怎么用?C# TypeDefinition.TypeOrBaseImplements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.TypeDefinition
的用法示例。
在下文中一共展示了TypeDefinition.TypeOrBaseImplements方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoTypeFailed
private bool DoTypeFailed(TypeDefinition type)
{
bool failed = false;
if (DoCheckSuffix(type, "Attribute"))
failed = !type.IsSubclassOf("System.Attribute", Cache);
else if (DoCheckSuffix(type, "Queue"))
failed = !type.IsSubclassOf("System.Collections.Queue", Cache);
else if (DoCheckSuffix(type, "Dictionary"))
failed = !type.TypeOrBaseImplements("System.Collections.IDictionary", Cache);
else if (DoCheckSuffix(type, "Stack"))
failed = !type.IsSubclassOf("System.Collections.Stack", Cache);
else if (DoCheckSuffix(type, "Collection"))
failed = !type.IsSubclassOf("System.Collections.Queue", Cache) &&
!type.IsSubclassOf("System.Collections.Stack", Cache) &&
!type.IsSubclassOf("System.Data.DataSet", Cache) &&
!type.IsSubclassOf("System.Data.DataTable", Cache) &&
!type.TypeOrBaseImplements("System.Collections.ICollection", Cache) &&
!type.TypeOrBaseImplements("System.Collections.IEnumerable", Cache) &&
!type.TypeOrBaseImplements("System.Collections.Generic.ICollection", Cache);
else if (DoCheckSuffix(type, "EventArgs"))
failed = !type.IsSubclassOf("System.EventArgs", Cache);
else if (DoCheckSuffix(type, "Exception"))
failed = !type.IsSubclassOf("System.Exception", Cache);
else if (DoCheckSuffix(type, "Stream"))
failed = !type.IsSubclassOf("System.IO.Stream", Cache);
else if (DoCheckSuffix(type, "Permission"))
failed = !type.TypeOrBaseImplements("System.Security.IPermission", Cache);
return failed;
}
示例2: DoInterfaceFailed
private bool DoInterfaceFailed(TypeDefinition type)
{
bool failed = false;
if (type.TypeOrBaseImplements("System.Collections.IDictionary", Cache))
failed = DoCheckSuffix(type, "Dictionary");
else if (type.TypeOrBaseImplements("System.Collections.Generic.IDictionary", Cache))
failed = DoCheckSuffix(type, "Dictionary");
else if (type.TypeOrBaseImplements("System.Collections.ICollection", Cache))
failed = DoCheckSuffix(type, "Collection");
else if (type.TypeOrBaseImplements("System.Collections.Generic.ICollection", Cache))
failed = DoCheckSuffix(type, "Collection");
else if (type.TypeOrBaseImplements("System.Collections.IEnumerable", Cache))
failed = DoCheckSuffix(type, "Collection");
else if (type.TypeOrBaseImplements("System.Security.IPermission", Cache))
failed = DoCheckSuffix(type, "Permission");
else if (type.TypeOrBaseImplements("System.Security.Policy.IMembershipCondition", Cache))
failed = DoCheckSuffix(type, "Condition");
return failed;
}