class CustomAttributeExtensions
in global :: System . Reflection
Contains static methods for retrieving custom attributes.
public static Attribute GetCustomAttribute( Assembly element, Type attributeType )
Retrieves a custom attribute of a specified type that is applied to a specified assembly.
elementThe assembly to inspect.attributeTypeThe type of attribute to search for.- Returns A custom attribute that matches , or if no such attribute is found.
public static Attribute GetCustomAttribute( MemberInfo element, Type attributeType )
Retrieves a custom attribute of a specified type that is applied to a specified member.
elementThe member to inspect.attributeTypeThe type of attribute to search for.- Returns A custom attribute that matches , or if no such attribute is found.
public static Attribute GetCustomAttribute( MemberInfo element, Type attributeType, bool inherit )
Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.
elementThe member to inspect.attributeTypeThe type of attribute to search for.inheritto inspect the ancestors of ; otherwise, .- Returns A custom attribute that matches , or if no such attribute is found.
public static Attribute GetCustomAttribute( Module element, Type attributeType )
Retrieves a custom attribute of a specified type that is applied to a specified module.
elementThe module to inspect.attributeTypeThe type of attribute to search for.- Returns A custom attribute that matches , or if no such attribute is found.
public static Attribute GetCustomAttribute( ParameterInfo element, Type attributeType )
Retrieves a custom attribute of a specified type that is applied to a specified parameter.
elementThe parameter to inspect.attributeTypeThe type of attribute to search for.- Returns A custom attribute that matches , or if no such attribute is found.
public static Attribute GetCustomAttribute( ParameterInfo element, Type attributeType, bool inherit )
Retrieves a custom attribute of a specified type that is applied to a specified parameter, and optionally inspects the ancestors of that parameter.
elementThe parameter to inspect.attributeTypeThe type of attribute to search for.inheritto inspect the ancestors of ; otherwise, .- Returns A custom attribute matching , or if no such attribute is found.
public static IEnumerable<T> GetCustomAttributes( Assembly element )
Retrieves a collection of custom attributes that are applied to a specified assembly.
elementThe assembly to inspect.- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( Assembly element )
Retrieves a collection of custom attributes that are applied to a specified assembly.
elementThe assembly to inspect.- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( Assembly element, Type attributeType )
Retrieves a collection of custom attributes of a specified type that are applied to a specified assembly.
elementThe assembly to inspect.attributeTypeThe type of attribute to search for.- Returns A collection of the custom attributes that are applied to and that match , or an empty collection if no such attributes exist.
public static IEnumerable<T> GetCustomAttributes( MemberInfo element )
Retrieves a collection of custom attributes that are applied to a specified member.
elementThe member to inspect.- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( MemberInfo element )
Retrieves a collection of custom attributes that are applied to a specified member.
elementThe member to inspect.- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<T> GetCustomAttributes( MemberInfo element, bool inherit )
Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member.
elementThe member to inspect.inheritto inspect the ancestors of ; otherwise, .- Returns A collection of the custom attributes that are applied to that match the specified criteria, or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( MemberInfo element, bool inherit )
Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member.
elementThe member to inspect.inheritto inspect the ancestors of ; otherwise, .- Returns A collection of the custom attributes that are applied to that match the specified criteria, or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( MemberInfo element, Type attributeType )
Retrieves a collection of custom attributes of a specified type that are applied to a specified member.
elementThe member to inspect.attributeTypeThe type of attribute to search for.- Returns A collection of the custom attributes that are applied to and that match , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( MemberInfo element, Type attributeType, bool inherit )
Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.
elementThe member to inspect.attributeTypeThe type of attribute to search for.inheritto inspect the ancestors of ; otherwise, .- Returns A collection of the custom attributes that are applied to and that match , or an empty collection if no such attributes exist.
public static IEnumerable<T> GetCustomAttributes( Module element )
Retrieves a collection of custom attributes that are applied to a specified module.
elementThe module to inspect.- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( Module element )
Retrieves a collection of custom attributes that are applied to a specified module.
elementThe module to inspect.- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( Module element, Type attributeType )
Retrieves a collection of custom attributes of a specified type that are applied to a specified module.
elementThe module to inspect.attributeTypeThe type of attribute to search for.- Returns A collection of the custom attributes that are applied to and that match , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( ParameterInfo element )
Retrieves a collection of custom attributes that are applied to a specified parameter.
elementThe parameter to inspect.- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<T> GetCustomAttributes( ParameterInfo element )
Retrieves a collection of custom attributes that are applied to a specified parameter.
elementThe parameter to inspect.- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( ParameterInfo element, bool inherit )
Retrieves a collection of custom attributes that are applied to a specified parameter, and optionally inspects the ancestors of that parameter.
elementThe parameter to inspect.inheritto inspect the ancestors of ; otherwise, .- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<T> GetCustomAttributes( ParameterInfo element, bool inherit )
Retrieves a collection of custom attributes that are applied to a specified parameter, and optionally inspects the ancestors of that parameter.
elementThe parameter to inspect.inheritto inspect the ancestors of ; otherwise, .- Returns A collection of the custom attributes that are applied to , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( ParameterInfo element, Type attributeType )
Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter.
elementThe parameter to inspect.attributeTypeThe type of attribute to search for.- Returns A collection of the custom attributes that are applied to and that match , or an empty collection if no such attributes exist.
public static IEnumerable<Attribute> GetCustomAttributes( ParameterInfo element, Type attributeType, bool inherit )
Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter, and optionally inspects the ancestors of that parameter.
elementThe parameter to inspect.attributeTypeThe type of attribute to search for.inheritto inspect the ancestors of ; otherwise, .- Returns A collection of the custom attributes that are applied to and that match , or an empty collection if no such attributes exist.
public static bool IsDefined( Assembly element, Type attributeType )
Indicates whether custom attributes of a specified type are applied to a specified assembly.
elementThe assembly to inspect.attributeTypeThe type of the attribute to search for.- Returns if an attribute of the specified type is applied to ; otherwise, .
public static bool IsDefined( MemberInfo element, Type attributeType )
Indicates whether custom attributes of a specified type are applied to a specified member.
elementThe member to inspect.attributeTypeThe type of attribute to search for.- Returns if an attribute of the specified type is applied to ; otherwise, .
public static bool IsDefined( MemberInfo element, Type attributeType, bool inherit )
Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors.
elementThe member to inspect.attributeTypeThe type of the attribute to search for.inheritto inspect the ancestors of ; otherwise, .- Returns if an attribute of the specified type is applied to ; otherwise, .
public static bool IsDefined( Module element, Type attributeType )
Indicates whether custom attributes of a specified type are applied to a specified module.
elementThe module to inspect.attributeTypeThe type of attribute to search for.- Returns if an attribute of the specified type is applied to ; otherwise, .
public static bool IsDefined( ParameterInfo element, Type attributeType )
Indicates whether custom attributes of a specified type are applied to a specified parameter.
elementThe parameter to inspect.attributeTypeThe type of attribute to search for.- Returns if an attribute of the specified type is applied to ; otherwise, .
public static bool IsDefined( ParameterInfo element, Type attributeType, bool inherit )
Indicates whether custom attributes of a specified type are applied to a specified parameter, and, optionally, applied to its ancestors.
elementThe parameter to inspect.attributeTypeThe type of attribute to search for.inheritto inspect the ancestors of ; otherwise, .- Returns if an attribute of the specified type is applied to ; otherwise, .
public string ToString( )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public static T GetCustomAttribute( MemberInfo element )
😔 No documentation found.
public static T GetCustomAttribute( ParameterInfo element )
😔 No documentation found.
public static T GetCustomAttribute( MemberInfo element, bool inherit )
😔 No documentation found.
public static T GetCustomAttribute( ParameterInfo element, bool inherit )
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.
public static T GetCustomAttribute( Module element )
😔 No documentation found.
public static T GetCustomAttribute( Assembly element )
😔 No documentation found.