MemberTypes Enumeration

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Marks each type of member that is defined as a derived class of MemberInfo.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

public enum MemberTypes

Member nameDescription
ConstructorSpecifies that the member is a constructor, representing a ConstructorInfo member. Hexadecimal value of 0x01.
EventSpecifies that the member is an event, representing an EventInfo member. Hexadecimal value of 0x02.
FieldSpecifies that the member is a field, representing a FieldInfo member. Hexadecimal value of 0x04.
MethodSpecifies that the member is a method, representing a MethodInfo member. Hexadecimal value of 0x08.
PropertySpecifies that the member is a property, representing a PropertyInfo member. Hexadecimal value of 0x10.
TypeInfoSpecifies that the member is a type, representing a TypeInfo member. Hexadecimal value of 0x20.
CustomSpecifies that the member is a custom member type. Hexadecimal value of 0x40.
NestedTypeSpecifies that the member is a nested type, extending MemberInfo.
AllSpecifies all member types.

These enum values are returned by MemberType and are useful in switch statements. MemberTypes matches CorTypeAttr as defined in the corhdr.h file.

To obtain the MemberTypes value for a method:

  • First get a Type.

  • From the Type, get the MemberInfo array.

  • From the MemberInfo array, get the MemberType.