Show / Hide Table of Contents

Class CustomAttribute

Contains static methods for retrieving custom attributes.

Inheritance
Object
CustomAttribute
Namespace: DotNext.Reflection
Assembly: DotNext.dll
Syntax
public static class CustomAttribute : object

Methods

| Improve this Doc View Source

IsDefined<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 A or any of its derived types is applied to the provided assembly; otherwise, false.

Type Parameters
Name Description
A

The type of custom attribute to search for. The search includes derived types.

| Improve this Doc View Source

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 A or any of its derived types is applied to the provided member; otherwise, false.

Type Parameters
Name Description
A

The type of custom attribute to search for. The search includes derived types.

| Improve this Doc View Source

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 A or any of its derived types is applied to the provided module; otherwise, false.

Type Parameters
Name Description
A

The type of custom attribute to search for. The search includes derived types.

| Improve this Doc View Source

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 A or any of its derived types is applied to the provided parameter; otherwise, false.

Type Parameters
Name Description
A

The type of custom attribute to search for. The search includes derived types.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX