Overview
Represents a member (such as a field, method, or property) of a type. This is an abstract base class that provides a common mechanism for accessing properties of members and serves as the base class for types that represent individual members.
The MemberInfo
class and its derived classes allow you to use reflection to discover information about your code's metadata, such as the name, type, and modifiers of members, as well as to access member values.
Syntax
public abstract class MemberInfo : ICustomAttributeProvider
Namespace:System.Reflection
Assembly:System.Private.CoreLib
(in System.Private.CoreLib.dll)
Inheritance
Inheritance Hierarchy
-
object
MemberInfo
-
FieldInfo
MethodBase
(abstract)PropertyInfo
EventInfo
TypeInfo
(abstract)ConstructorInfo
- ...
Fields
MemberInfo
does not declare any fields.
Properties
Methods
object[] GetCustomAttributes(bool inherit)
When overridden in a derived class, returns an array of custom attribute objects that are directly applied to this member, and identifies whether the applied custom attributes are inherited or not.
object[] GetCustomAttributes(Type attributeType, bool inherit)
When overridden in a derived class, searches for the specified attribute type on this member, and returns either all the custom attribute objects, or all the custom attribute objects that match the specified type. Identifies whether the applied custom attributes are inherited or not.
bool IsDefined(Type attributeType, bool inherit)
Indicates whether or not attribute data is associated with this member.
Attributes
The MemberInfo
class is abstract and does not have attributes directly applied to it. Its derived classes may have specific attributes.