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!

PropertyInfo.MemberType

Retrieves the Type of property reflected by this PropertyInfo object.

[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.

Remarks

MemberType is a subclass of MemberInfo and specifies the type of member this is. Member types are constructors, properties, fields, methods, etc. Since this is a PropertyInfo property, the returned type is a Property.

To get the MemberType property, first get the class Type. From the Type, get the PropertyInfo. From the PropertyInfo, get the MemberType value.

Example [C#]

[C#]

class Mypropertyinfo
{
   public static int Main()
   {
      Console.WriteLine("\nReflection.PropertyInfo");
 
      //Get the type and PropertyInfo
      Type MyType = Type.GetType("System.Reflection.MemberInfo");
      PropertyInfo Mypropertyinfo = MyType.GetProperty("Name");
 
      //Read and display the MemberType property
      Console.Write("\nMemberType = " + EnumInfo.ToString(Type.GetType("System.Reflection.MemberTypes"), Mypropertyinfo.MemberType));
 
      return 0;
   }
}
Produces the following output

Reflection.PropertyInfo
MemberType = Property

See Also

PropertyInfo Class | PropertyInfo Members | System.Reflection Namespace