Add isDelegate() method

This commit is contained in:
de4dot 2011-11-04 00:06:25 +01:00
parent 8b0bf54d62
commit 76241db427

View File

@ -278,8 +278,12 @@ namespace de4dot.blocks {
}
}
public static bool isDelegate(TypeReference type) {
return type != null && (type.FullName == "System.Delegate" || type.FullName == "System.MulticastDelegate");
}
public static bool isDelegateType(TypeDefinition type) {
return type != null && type.BaseType != null && type.BaseType.FullName == "System.MulticastDelegate";
return type != null && isDelegate(type.BaseType);
}
public static bool isSameAssembly(TypeReference type, string assembly) {