CustomAttributeExtensions.IsDefined CustomAttributeExtensions.IsDefined CustomAttributeExtensions.IsDefined CustomAttributeExtensions.IsDefined Method

Definition

Indicates whether custom attributes are applied to an element.

Overloads

IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean)

Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors.

IsDefined(Assembly, Type) IsDefined(Assembly, Type) IsDefined(Assembly, Type) IsDefined(Assembly, Type)

Indicates whether custom attributes of a specified type are applied to a specified assembly.

IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type)

Indicates whether custom attributes of a specified type are applied to a specified member.

IsDefined(Module, Type) IsDefined(Module, Type) IsDefined(Module, Type) IsDefined(Module, Type)

Indicates whether custom attributes of a specified type are applied to a specified module.

IsDefined(ParameterInfo, Type) IsDefined(ParameterInfo, Type) IsDefined(ParameterInfo, Type) IsDefined(ParameterInfo, Type)

Indicates whether custom attributes of a specified type are applied to a specified parameter.

IsDefined(ParameterInfo, Type, Boolean) IsDefined(ParameterInfo, Type, Boolean) IsDefined(ParameterInfo, Type, Boolean) IsDefined(ParameterInfo, Type, Boolean)

Indicates whether custom attributes of a specified type are applied to a specified parameter, and, optionally, applied to its ancestors.

IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean)

Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsDefined(System::Reflection::MemberInfo ^ element, Type ^ attributeType, bool inherit);
public static bool IsDefined (this System.Reflection.MemberInfo element, Type attributeType, bool inherit);
static member IsDefined : System.Reflection.MemberInfo * Type * bool -> bool
<Extension()>
Public Function IsDefined (element As MemberInfo, attributeType As Type, inherit As Boolean) As Boolean

Parameters

element
MemberInfo MemberInfo MemberInfo MemberInfo

The member to inspect.

attributeType
Type Type Type Type

The type of the attribute to search for.

inherit
Boolean Boolean Boolean Boolean

true to inspect the ancestors of element; otherwise, false.

Returns

true if an attribute of the specified type is applied to element; otherwise, false.

Exceptions

element is not a constructor, method, property, event, type, or field.

IsDefined(Assembly, Type) IsDefined(Assembly, Type) IsDefined(Assembly, Type) IsDefined(Assembly, Type)

Indicates whether custom attributes of a specified type are applied to a specified assembly.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsDefined(System::Reflection::Assembly ^ element, Type ^ attributeType);
public static bool IsDefined (this System.Reflection.Assembly element, Type attributeType);
static member IsDefined : System.Reflection.Assembly * Type -> bool
<Extension()>
Public Function IsDefined (element As Assembly, attributeType As Type) As Boolean

Parameters

element
Assembly Assembly Assembly Assembly

The assembly to inspect.

attributeType
Type Type Type Type

The type of the attribute to search for.

Returns

true if an attribute of the specified type is applied to element; otherwise, false.

Exceptions

IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type)

Indicates whether custom attributes of a specified type are applied to a specified member.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsDefined(System::Reflection::MemberInfo ^ element, Type ^ attributeType);
public static bool IsDefined (this System.Reflection.MemberInfo element, Type attributeType);
static member IsDefined : System.Reflection.MemberInfo * Type -> bool
<Extension()>
Public Function IsDefined (element As MemberInfo, attributeType As Type) As Boolean

Parameters

element
MemberInfo MemberInfo MemberInfo MemberInfo

The member to inspect.

attributeType
Type Type Type Type

The type of attribute to search for.

Returns

true if an attribute of the specified type is applied to element; otherwise, false.

Exceptions

element is not a constructor, method, property, event, type, or field.

IsDefined(Module, Type) IsDefined(Module, Type) IsDefined(Module, Type) IsDefined(Module, Type)

Indicates whether custom attributes of a specified type are applied to a specified module.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsDefined(System::Reflection::Module ^ element, Type ^ attributeType);
public static bool IsDefined (this System.Reflection.Module element, Type attributeType);
static member IsDefined : System.Reflection.Module * Type -> bool
<Extension()>
Public Function IsDefined (element As Module, attributeType As Type) As Boolean

Parameters

element
Module Module Module Module

The module to inspect.

attributeType
Type Type Type Type

The type of attribute to search for.

Returns

true if an attribute of the specified type is applied to element; otherwise, false.

Exceptions

IsDefined(ParameterInfo, Type) IsDefined(ParameterInfo, Type) IsDefined(ParameterInfo, Type) IsDefined(ParameterInfo, Type)

Indicates whether custom attributes of a specified type are applied to a specified parameter.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsDefined(System::Reflection::ParameterInfo ^ element, Type ^ attributeType);
public static bool IsDefined (this System.Reflection.ParameterInfo element, Type attributeType);
static member IsDefined : System.Reflection.ParameterInfo * Type -> bool
<Extension()>
Public Function IsDefined (element As ParameterInfo, attributeType As Type) As Boolean

Parameters

element
ParameterInfo ParameterInfo ParameterInfo ParameterInfo

The parameter to inspect.

attributeType
Type Type Type Type

The type of attribute to search for.

Returns

true if an attribute of the specified type is applied to element; otherwise, false.

Exceptions

IsDefined(ParameterInfo, Type, Boolean) IsDefined(ParameterInfo, Type, Boolean) IsDefined(ParameterInfo, Type, Boolean) IsDefined(ParameterInfo, Type, Boolean)

Indicates whether custom attributes of a specified type are applied to a specified parameter, and, optionally, applied to its ancestors.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsDefined(System::Reflection::ParameterInfo ^ element, Type ^ attributeType, bool inherit);
public static bool IsDefined (this System.Reflection.ParameterInfo element, Type attributeType, bool inherit);
static member IsDefined : System.Reflection.ParameterInfo * Type * bool -> bool
<Extension()>
Public Function IsDefined (element As ParameterInfo, attributeType As Type, inherit As Boolean) As Boolean

Parameters

element
ParameterInfo ParameterInfo ParameterInfo ParameterInfo

The parameter to inspect.

attributeType
Type Type Type Type

The type of attribute to search for.

inherit
Boolean Boolean Boolean Boolean

true to inspect the ancestors of element; otherwise, false.

Returns

true if an attribute of the specified type is applied to element; otherwise, false.

Exceptions

Applies to