Exemple #1
0
 /// <summary>
 /// Gets the <see cref="System.Attribute"/>s associated with the enumeration given in <paramref name="provider"/>.
 /// The resulting list of attributes can optionally be filtered by suppliying a list of <paramref name="attributeTypes"/>
 /// to include.
 /// </summary>
 /// <returns>A list of the attributes found on the supplied source. This value will never be null.</returns>
 public static IList <Attribute> Attributes(this Enum provider, params Type[] attributeTypes)
 {
     return(ReflectLookup.Attributes(provider, attributeTypes));
 }
Exemple #2
0
 /// <summary>
 /// Determines whether the <paramref name="provider"/> element has an associated <see cref="System.Attribute"/>
 /// of type <paramref name="attributeType"/>.
 /// </summary>
 /// <returns>True if the source element has the associated attribute, false otherwise.</returns>
 public static bool HasAttribute(this ICustomAttributeProvider provider, Type attributeType)
 {
     return(ReflectLookup.HasAttribute(provider, attributeType));
 }
Exemple #3
0
 /// <summary>
 /// Gets the <see cref="System.Attribute"/>s associated with the enumeration given in <paramref name="provider"/>.
 /// </summary>
 /// <typeparam name="T">The attribute type to search for.</typeparam>
 /// <param name="provider">An enumeration on which to search for attributes of the given type.</param>
 /// <returns>A list of the attributes found on the supplied source. This value will never be null.</returns>
 public static IList <T> Attributes <T>(this Enum provider) where T : Attribute
 {
     return(ReflectLookup.Attributes <T>(provider));
 }