本文整理匯總了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;
}