public bool IsAttributePresent(Type attributeType) { if (CustomAttributeProvider != null) { return(CustomAttributeProvider.IsDefined(attributeType, false)); } try { CustomAttributeData cad = GetAttribute(attributeType); return(cad != null); } catch (CustomAttributeFormatException) { CustomAttributeProvider = Member; return(IsAttributePresent(attributeType)); } }
/// <summary> /// Are one or more attributes of the given type defined on this member. /// </summary> /// <param name="attributeType">The type of the custom attribute</param> /// <param name="inherit">If true, look in base classes for inherited custom attributes.</param> public bool IsDefined(Type attributeType, bool inherit) { return(CustomAttributeProvider.IsDefined(this, attributeType, inherit)); }
public override bool IsDefined(Type attributeType, bool inherit) { return(_customAttributeProvider.IsDefined(attributeType, inherit)); }