Mono Class Library: System.Reflection.PropertyInfo Overview | Members

System.Reflection.PropertyInfo.GetGetMethod Method

Returns the public possibly or, if specified, the non-public Get accessor for the property reflected by the current instance. [Edit]

public abstract MethodInfo GetGetMethod (bool nonPublic)

Parameters

nonPublic
A bool value that indicates whether a non-public Get accessor will be returned. Specify true to allow a non-public accessor; otherwise, specify false. [Edit]

Returns

If nonPublic is true, returns a System.Reflection.MethodInfo instance that reflects the Get accessor for the property reflected by the current instance if that accessor exists. If nonPublic is false and the Get accessor is non-public, or nonPublic is true but no Get accessor exists for the property reflected by the current instance, returns null . [Edit]

Permissions

TypeReason
System.Security.Permissions.ReflectionPermission [Edit] Requires permission to reflect non-public members of a type in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.

Exceptions

TypeReason
MethodAccessExceptionnonPublic is true, the Get accessor for the property reflected by the current instance is non-public, and the caller does not have System.Security.Permissions.ReflectionPermission to reflect on non-public methods. [Edit]

Remarks

Operation
As described above. [Edit]

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0