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