You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
738 B
27 lines
738 B
3 years ago
|
namespace ILRuntime.CLR.Method
|
||
|
{
|
||
|
public static class IMethodExtensions
|
||
|
{
|
||
|
public static bool IsExtendMethod(this ILMethod im)
|
||
|
{
|
||
|
if (!im.IsStatic || im.ParameterCount == 0)
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return im.ReflectionMethodInfo.GetCustomAttributes(typeof(System.Runtime.CompilerServices.ExtensionAttribute), false).Length > 0;
|
||
|
|
||
|
}
|
||
|
public static bool IsExtendMethod(this CLRMethod cm)
|
||
|
{
|
||
|
if (!cm.IsStatic || cm.ParameterCount == 0)
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return cm.MethodInfo.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), false);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|