internal static bool IsDefined(RuntimeType type, RuntimeType caType, bool inherit)
{
ASSERT.PRECONDITION(type != null);
if (type.GetElementType() != null)
return false;
if (PseudoCustomAttribute.IsDefined(type, caType))
return true;
if (IsCustomAttributeDefined(type.Module, type.MetadataToken, caType))
return true;
if (!inherit)
return false;
type = type.BaseType as RuntimeType;
while (type != null)
{
if (IsCustomAttributeDefined(type.Module, type.MetadataToken, caType, inherit))
return true;
type = type.BaseType as RuntimeType;
}
return false;
}