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!

MemberInfo.MemberType

Retrieves a the type of this member.

[Visual Basic]
MustOverride Public ReadOnly Property MemberType As MemberTypes
[C#]
public MemberTypes MemberType {abstract get;}
[C++]
public: __property virtual MemberTypes get_MemberType() = 0;
[JScript]
public abstract function get MemberType() : MemberTypes;

Property Value

Read-only.

An enumerated value from the MemberTypes class describing this member as a constructor, event, field, method, property, type information, all, or custom.

Remarks

The MemberTypes property retrieves a MemberTypes object that describes this member as constructor, event, field, method, property, type information, all, or custom.

The returned value is from the MemberTypes enumeration, an enumerated value from the MemberTypes class describing this member as a constructor, event, field, method, property, type information, all, or custom.

To get the MemberType property:

Example [C#]

[C#]

class Mymemberinfo
{
   public static int Main()
   {
      Console.WriteLine ("\nReflection.MemberInfo");
      
      //Get the Type and
MemberInfo
      Type MyType =
Type.GetType("System.Reflection.PropertyInfo");
      MemberInfo[] Mymemberinfoarray = MyType.GetMembers();
 
      //Get MemberType
method- display the 38th- 41th elements only
      Console.Write("\nThere are {0} members in "
         Mymemberinfoarray.Count);
      Console.Write("{0}.", MyType.FullName);
 
      for ( int counter =
37; counter <40; counter++)
      {
         Console.Write("\n" + counter +
". "
+ Mymemberinfoarray[counter].Name
+ " Member type - " +
EnumInfo.ToString(typeof(MemberTypes),
Mymemberinfoarray[counter].MemberType));
      }
      return 0;
   }
}
Produces the following output
Reflection.MemberInfo
 
There are 52 members in System.Reflection.PropertyInfo.
37. GetCanRead Member type - Method
38. GetCanWrite Member type - Method
39. MemberType Member type - Property
40. PropertyType Member type - Property

[To be supplied]

See Also

MemberInfo Class | MemberInfo Members | System.Reflection Namespace