private static bool InternalIsDefined(PropertyInfo element, Type attributeType, bool inherit)
{
if (element.IsDefined(attributeType, inherit))
{
return(true);
}
if (inherit && Attribute.InternalGetAttributeUsage(attributeType).Inherited)
{
for (PropertyInfo parentDefinition = Attribute.GetParentDefinition(element); parentDefinition != (PropertyInfo)null; parentDefinition = Attribute.GetParentDefinition(parentDefinition))
{
if (parentDefinition.IsDefined(attributeType, false))
{
return(true);
}
}
}
return(false);
}