Obtains information about the attributes of a member and provides access to member metadata.
More...
|
abstract object [] | GetCustomAttributes (bool inherit) |
| When overridden in a derived class, returns an array of all custom attributes applied to this member. More...
|
|
abstract object [] | GetCustomAttributes (Type attributeType, bool inherit) |
| When overridden in a derived class, returns an array of custom attributes applied to this member and identified by T:System.Type. More...
|
|
abstract bool | IsDefined (Type attributeType, bool inherit) |
| When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. More...
|
|
virtual IList< CustomAttributeData > | GetCustomAttributesData () |
| Returns a list of T:System.Reflection.CustomAttributeData objects representing data about the attributes that have been applied to the target member. More...
|
|
override bool | Equals (object obj) |
| Returns a value that indicates whether this instance is equal to a specified object. More...
|
|
override int | GetHashCode () |
| Returns the hash code for this instance. More...
|
|
new string | ToString () |
| Provides COM objects with version-independent access to the M:System.Object.ToString method. More...
|
|
|
abstract MemberTypes | MemberType [get] |
| When overridden in a derived class, gets a T:System.Reflection.MemberTypes value indicating the type of the member — method, constructor, event, and so on. More...
|
|
abstract string | Name [get] |
| Gets the name of the current member. More...
|
|
abstract Type | DeclaringType [get] |
| Gets the class that declares this member. More...
|
|
abstract Type | ReflectedType [get] |
| Gets the class object that was used to obtain this instance of MemberInfo . More...
|
|
virtual IEnumerable< CustomAttributeData > | CustomAttributes [get] |
| Gets a collection that contains this member's custom attributes. More...
|
|
virtual int | MetadataToken [get] |
| Gets a value that identifies a metadata element. More...
|
|
virtual Module | Module [get] |
| Gets the module in which the type that declares the member represented by the current T:System.Reflection.MemberInfo is defined. More...
|
|
MemberTypes | MemberType [get] |
| Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.MemberType property. More...
|
|
string | Name [get] |
| Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.Name property. More...
|
|
Type | DeclaringType [get] |
| Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.DeclaringType property. More...
|
|
Type | ReflectedType [get] |
| Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.ReflectedType property. More...
|
|
Obtains information about the attributes of a member and provides access to member metadata.
Definition at line 14 of file MemberInfo.cs.
abstract object [] System.Reflection.MemberInfo.GetCustomAttributes |
( |
bool |
inherit | ) |
|
|
pure virtual |
When overridden in a derived class, returns an array of all custom attributes applied to this member.
- Parameters
-
inherit | true to search this member's inheritance chain to find the attributes; otherwise, false . This parameter is ignored for properties and events; see Remarks. |
- Returns
- An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.
- Exceptions
-
T:System.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. |
T:System.TypeLoadException | A custom attribute type could not be loaded. |
Implements System.Reflection.ICustomAttributeProvider.
Implemented in System.Reflection.Emit.TypeBuilder, System.Reflection.Emit.DynamicMethod, System.Reflection.Emit.MethodBuilder, System.Reflection.Emit.GenericTypeParameterBuilder, System.Reflection.Emit.EnumBuilder, System.Reflection.TypeDelegator, System.Reflection.Emit.PropertyBuilder, System.Reflection.Emit.ConstructorBuilder, System.Runtime.InteropServices.ComAwareEventInfo, and System.Reflection.Emit.FieldBuilder.
abstract object [] System.Reflection.MemberInfo.GetCustomAttributes |
( |
Type |
attributeType, |
|
|
bool |
inherit |
|
) |
| |
|
pure virtual |
When overridden in a derived class, returns an array of custom attributes applied to this member and identified by T:System.Type.
- Parameters
-
attributeType | The type of attribute to search for. Only attributes that are assignable to this type are returned. |
inherit | true to search this member's inheritance chain to find the attributes; otherwise, false . This parameter is ignored for properties and events; see Remarks. |
- Returns
- 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
-
T:System.TypeLoadException | A custom attribute type cannot be loaded. |
T:System.ArgumentNullException | If attributeType is null . |
T:System.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. |
Implements System.Reflection.ICustomAttributeProvider.
Implemented in System.Reflection.Emit.TypeBuilder, System.Reflection.Emit.DynamicMethod, System.Reflection.Emit.MethodBuilder, System.Reflection.Emit.GenericTypeParameterBuilder, System.Reflection.Emit.EnumBuilder, System.Reflection.TypeDelegator, System.Reflection.Emit.PropertyBuilder, System.Reflection.Emit.ConstructorBuilder, System.Reflection.Emit.FieldBuilder, and System.Runtime.InteropServices.ComAwareEventInfo.