NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MethodInfo.MemberType

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;

Property Value

Read-only. Returns a MemberTypes object indicating that this member is a method.

Remarks

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.

Example [C#]

[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

See Also

MethodInfo Class | MethodInfo Members | System.Reflection Namespace