예제 #1
0
 /// <summary>
 /// Gets the <see cref="System.Attribute"/>s associated with the <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 source element. This value will never be null.</returns>
 public static IList <Attribute> Attributes(this ICustomAttributeProvider provider, params Type[] attributeTypes)
 {
     return(ReflectLookup.Attributes(provider, attributeTypes));
 }
예제 #2
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));
 }