PropertyInfo::MemberType Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets a MemberTypes value indicating that this member is a property.

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

property MemberTypes MemberType {
	virtual MemberTypes get() override;

Property Value

Type: System.Reflection::MemberTypes

A MemberTypes value indicating that this member is a property.

This property overrides MemberType. Therefore, when you examine a set of MemberInfo objects — for example, the array returned by GetMembers — the MemberType property returns Property only when a given member is a property.

MemberType is a derived class of MemberInfo and specifies the type of member this is. Member types are constructors, properties, fields, and methods. 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.

The following example displays the type of the specified member.

using namespace System;
using namespace System::Reflection;
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 = {0}", Mypropertyinfo->MemberType );
   return 0;

.NET Framework
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top