Class CustomAttribute
Contains static methods for retrieving custom attributes.
Namespace: DotNext.Reflection
Assembly: DotNext.dll
Syntax
public static class CustomAttribute : object
Methods
| Improve this Doc View SourceIsDefined<A>(Assembly)
Returns a value that indicates whether the specified attribute type has been applied to the assembly.
Declaration
public static bool IsDefined<A>(this Assembly assembly)
where A : Attribute
Parameters
Type | Name | Description |
---|---|---|
Assembly | assembly | The assembly to inspect. |
Returns
Type | Description |
---|---|
Boolean | true if one or more instances of |
Type Parameters
Name | Description |
---|---|
A | The type of custom attribute to search for. The search includes derived types. |
IsDefined<A>(MemberInfo, Boolean)
Indicates whether one or more attributes of the specified type or of its derived types is applied to the member.
Declaration
public static bool IsDefined<A>(this MemberInfo member, bool inherit = false)
where A : Attribute
Parameters
Type | Name | Description |
---|---|---|
MemberInfo | member | The member to inspect. |
Boolean | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. |
Returns
Type | Description |
---|---|
Boolean | true if one or more instances of |
Type Parameters
Name | Description |
---|---|
A | The type of custom attribute to search for. The search includes derived types. |
IsDefined<A>(Module)
Returns a value that indicates whether the specified attribute type has been applied to the module.
Declaration
public static bool IsDefined<A>(this Module module)
where A : Attribute
Parameters
Type | Name | Description |
---|---|---|
Module | module | The module to inspect. |
Returns
Type | Description |
---|---|
Boolean | true if one or more instances of |
Type Parameters
Name | Description |
---|---|
A | The type of custom attribute to search for. The search includes derived types. |
IsDefined<A>(ParameterInfo)
Returns a value that indicates whether the specified attribute type has been applied to the parameter.
Declaration
public static bool IsDefined<A>(this ParameterInfo parameter)
where A : Attribute
Parameters
Type | Name | Description |
---|---|---|
ParameterInfo | parameter | The parameter to inspect. |
Returns
Type | Description |
---|---|
Boolean | true if one or more instances of |
Type Parameters
Name | Description |
---|---|
A | The type of custom attribute to search for. The search includes derived types. |