PropertyBuilder::GetGetMethod Method (Boolean)

 

Returns the public and non-public get accessor for this property.

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

public:
virtual MethodInfo^ GetGetMethod(
	bool nonPublic
) override

Parameters

nonPublic
Type: System::Boolean

Indicates whether non-public get accessors should be returned. true if non-public methods are to be included; otherwise, false.

Return Value

Type: System.Reflection::MethodInfo^

A MethodInfo object representing the get accessor for this property, if nonPublic is true. Returns null if nonPublic is false and the get accessor is non-public, or if nonPublic is true but no get accessors exist.

To get the getter of a property, reflect on the property's parent type using Type.GetType or Assembly.GetType, retrieve the Reflection property object from the type, and call PropertyInfo.GetGetMethod.

.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Return to top
Show: