/// <summary> /// Gets the first <see cref="System.Attribute"/> of type <paramref name="attributeType"/> associated with the /// enumeration value given in the <paramref name="provider"/> parameter. /// </summary> /// <param name="provider">An enumeration value on which to search for the attribute.</param> /// <param name="attributeType">The attribute type to search for.</param> /// <returns>The first attribute found on the source.</returns> public static Attribute Attribute(this Enum provider, Type attributeType) { return(ReflectLookup.Attribute(provider, attributeType)); }
/// <summary> /// Gets the first <see cref="System.Attribute"/> of type <typeparamref name="T"/> associated with the <paramref name="provider"/>. /// </summary> /// <returns>The first attribute found on the source element.</returns> public static T Attribute <T>(this ICustomAttributeProvider provider) where T : Attribute { return(ReflectLookup.Attribute <T>(provider)); }
/// <summary> /// Gets the first <see cref="System.Attribute"/> of type <typeparamref name="T"/> associated with the /// enumeration value given in the <paramref name="provider"/> parameter. /// </summary> /// <typeparam name="T">The attribute type to search for.</typeparam> /// <param name="provider">An enumeration value on which to search for the attribute.</param> /// <returns>The first attribute found on the source.</returns> public static T Attribute <T>(this Enum provider) where T : Attribute { return(ReflectLookup.Attribute <T>(provider)); }
/// <summary> /// Gets the first <see cref="System.Attribute"/> of type <paramref name="attributeType"/> associated with the <paramref name="provider"/>. /// </summary> /// <returns>The first attribute found on the source element.</returns> public static Attribute Attribute(this ICustomAttributeProvider provider, Type attributeType) { return(ReflectLookup.Attribute(provider, attributeType)); }