CustomAttributeExtensions Class
Provides extension methods for checking custom attributes on reflection types.
public static class CustomAttributeExtensionsMethods
| Name | Description |
|---|---|
| HasCustomAttribute(Assembly, Type) | Determines whether a custom attribute of the specified type is applied to the assembly. |
| HasCustomAttribute(Assembly, Type, bool) | Determines whether a custom attribute of the specified type is applied to the assembly. |
| HasCustomAttribute(MemberInfo, Type) | Determines whether a custom attribute of the specified type is applied to the member. |
| HasCustomAttribute(MemberInfo, Type, bool) | Determines whether a custom attribute of the specified type is applied to the member. |
| HasCustomAttribute(Module, Type) | Determines whether a custom attribute of the specified type is applied to the module. |
| HasCustomAttribute(Module, Type, bool) | Determines whether a custom attribute of the specified type is applied to the module. |
| HasCustomAttribute(ParameterInfo, Type) | Determines whether a custom attribute of the specified type is applied to the parameter. |
| HasCustomAttribute(ParameterInfo, Type, bool) | Determines whether a custom attribute of the specified type is applied to the parameter. |
| HasCustomAttribute(Type, Type) | Determines whether a custom attribute of the specified type is applied to the type. |
| HasCustomAttribute(Type, Type, bool) | Determines whether a custom attribute of the specified type is applied to the type. |
| HasCustomAttribute<T>(Assembly) | Determines whether a custom attribute of the specified type is applied to the assembly. |
| HasCustomAttribute<T>(Assembly, bool) | Determines whether a custom attribute of the specified type is applied to the assembly. |
| HasCustomAttribute<T>(MemberInfo) | Determines whether a custom attribute of the specified type is applied to the member. |
| HasCustomAttribute<T>(MemberInfo, bool) | Determines whether a custom attribute of the specified type is applied to the member. |
| HasCustomAttribute<T>(Module) | Determines whether a custom attribute of the specified type is applied to the module. |
| HasCustomAttribute<T>(Module, bool) | Determines whether a custom attribute of the specified type is applied to the module. |
| HasCustomAttribute<T>(ParameterInfo) | Determines whether a custom attribute of the specified type is applied to the parameter. |
| HasCustomAttribute<T>(ParameterInfo, bool) | Determines whether a custom attribute of the specified type is applied to the parameter. |
| HasCustomAttribute<T>(Type) | Determines whether a custom attribute of the specified type is applied to the type. |
| HasCustomAttribute<T>(Type, bool) | Determines whether a custom attribute of the specified type is applied to the type. |
HasCustomAttribute overloads
HasCustomAttribute(Assembly, Type)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the assembly.
HasCustomAttribute(Assembly, Type, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the assembly.
HasCustomAttribute(MemberInfo, Type)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the member.
public static bool HasCustomAttribute(this MemberInfo member, Type attributeType)Parameters
memberMemberInfo- The member to check.
attributeTypeType- The type of attribute to search for.
Returns
bool true if the attribute is applied to the member; otherwise, false.
HasCustomAttribute(MemberInfo, Type, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the member.
public static bool HasCustomAttribute(this MemberInfo member, Type attributeType, bool inherit)Parameters
memberMemberInfo- The member to check.
attributeTypeType- The type of attribute to search for.
inheritbooltrueto search the member's inheritance chain to find the attributes; otherwise,false.
Returns
bool true if the attribute is applied to the member; otherwise, false.
HasCustomAttribute(Module, Type)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the module.
HasCustomAttribute(Module, Type, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the module.
HasCustomAttribute(ParameterInfo, Type)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the parameter.
public static bool HasCustomAttribute(this ParameterInfo parameter, Type attributeType)Parameters
parameterParameterInfo- The parameter to check.
attributeTypeType- The type of attribute to search for.
Returns
bool true if the attribute is applied to the parameter; otherwise, false.
HasCustomAttribute(ParameterInfo, Type, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the parameter.
public static bool HasCustomAttribute(this ParameterInfo parameter, Type attributeType, bool inherit)Parameters
parameterParameterInfo- The parameter to check.
attributeTypeType- The type of attribute to search for.
inheritbooltrueto search the parameter's inheritance chain to find the attributes; otherwise,false.
Returns
bool true if the attribute is applied to the parameter; otherwise, false.
HasCustomAttribute(Type, Type)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the type.
HasCustomAttribute(Type, Type, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the type.
HasCustomAttribute<T>(Assembly)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the assembly.
HasCustomAttribute<T>(Assembly, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the assembly.
HasCustomAttribute<T>(MemberInfo)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the member.
public static bool HasCustomAttribute<T>(this MemberInfo member) where T : AttributeType parameters
T- The type of attribute to search for.
Parameters
memberMemberInfo- The member to check.
Returns
bool true if the attribute is applied to the member; otherwise, false.
HasCustomAttribute<T>(MemberInfo, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the member.
public static bool HasCustomAttribute<T>(this MemberInfo member, bool inherit) where T : AttributeType parameters
T- The type of attribute to search for.
Parameters
memberMemberInfo- The member to check.
inheritbooltrueto search the member's inheritance chain to find the attributes; otherwise,false.
Returns
bool true if the attribute is applied to the member; otherwise, false.
HasCustomAttribute<T>(Module)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the module.
HasCustomAttribute<T>(Module, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the module.
HasCustomAttribute<T>(ParameterInfo)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the parameter.
public static bool HasCustomAttribute<T>(this ParameterInfo parameter) where T : AttributeType parameters
T- The type of attribute to search for.
Parameters
parameterParameterInfo- The parameter to check.
Returns
bool true if the attribute is applied to the parameter; otherwise, false.
HasCustomAttribute<T>(ParameterInfo, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the parameter.
public static bool HasCustomAttribute<T>(this ParameterInfo parameter, bool inherit) where T : AttributeType parameters
T- The type of attribute to search for.
Parameters
parameterParameterInfo- The parameter to check.
inheritbooltrueto search the parameter's inheritance chain to find the attributes; otherwise,false.
Returns
bool true if the attribute is applied to the parameter; otherwise, false.
HasCustomAttribute<T>(Type)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the type.
HasCustomAttribute<T>(Type, bool)
CustomAttributeExtensions.csDetermines whether a custom attribute of the specified type is applied to the type.