Beispiel #1
0
 /// <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));
 }
Beispiel #2
0
 /// <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));
 }
Beispiel #3
0
 /// <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));
 }
Beispiel #4
0
 /// <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));
 }