Retrieves a value indicating that this member is a method.
[Visual Basic] Overridable Public ReadOnly Property MemberType As MemberTypes [C#] public MemberTypes MemberType {override get;} [C++] public: __property virtual MemberTypes get_MemberType(); [JScript] public function get MemberType() : MemberTypes;
Read-only. Returns a MemberTypes object indicating that this member is a method.
This is used when this method is being tested as generic member.
To get the MemberType property, first get the class Type. From the Type, get the MethodInfo. From the MethodInfo, get the MemberType.
[C#]
class MyMethodInfo { public static int Main() { Console.WriteLine("\nReflection.MethodInfo"); //Get the Type and MethodInfo Type MyType = Type.GetType("System.Reflection.FieldInfo"); MethodInfo Mymethodinfo = MyType.GetMethod("GetValue"); Console.Write("\n" + MyType.FullName + "." + Mymethodinfo.Name); //Get and display the MemberType property MemberTypes Mymembertypes = Mymethodinfo.MemberType; Console.Write("\nMemberType - {0} ", EnumInfo.ToString(typeof(MemberTypes), Mymembertypes)); return 0; } } Produces the following output Reflection.MethodInfo System.Reflection.FieldInfo.GetValue MemberType - Method
MethodInfo Class | MethodInfo Members | System.Reflection Namespace