Method GetCustomAttributes
- Namespace
- Microsoft.Samples.Debugging.CorMetadata
- Assembly
- corapi.dll
GetCustomAttributes(bool)
When overridden in a derived class, returns an array of all custom attributes applied to this member.
public override object[] GetCustomAttributes(bool inherit)
Parameters
inherit
booltrue to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.
Returns
- object[]
An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.
Exceptions
- InvalidOperationException
This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context.
- TypeLoadException
A custom attribute type could not be loaded.
GetCustomAttributes(Type, bool)
When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type.
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
attributeType
TypeThe type of attribute to search for. Only attributes that are assignable to this type are returned.
inherit
booltrue to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.
Returns
- object[]
An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to
attributeType
have been applied.
Exceptions
- TypeLoadException
A custom attribute type cannot be loaded.
- ArgumentNullException
If
attributeType
is null.- InvalidOperationException
This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context.