internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType caType, bool inherit)
{
if (PseudoCustomAttribute.IsDefined(method, caType))
{
return(true);
}
if (CustomAttribute.IsCustomAttributeDefined(method.GetRuntimeModule(), method.MetadataToken, caType))
{
return(true);
}
if (!inherit)
{
return(false);
}
method = method.GetParentDefinition();
while (method != null)
{
if (CustomAttribute.IsCustomAttributeDefined(method.GetRuntimeModule(), method.MetadataToken, caType, 0, inherit))
{
return(true);
}
method = method.GetParentDefinition();
}
return(false);
}