PropertyBuilder.GetGetMethod(Boolean) Méthode

Définition

Retourne l'accesseur GET public et non public de cette propriété.

public:
 override System::Reflection::MethodInfo ^ GetGetMethod(bool nonPublic);
public override System.Reflection.MethodInfo? GetGetMethod (bool nonPublic);
public override System.Reflection.MethodInfo GetGetMethod (bool nonPublic);
override this.GetGetMethod : bool -> System.Reflection.MethodInfo
Public Overrides Function GetGetMethod (nonPublic As Boolean) As MethodInfo

Paramètres

nonPublic
Boolean

Indique si des accesseurs GET non publics doivent être retournés. true si les méthodes non publiques doivent être incluses ; sinon, false.

Retours

Objet MethodInfo représentant l'accesseur GET de cette propriété si nonPublic est true. Retourne null si nonPublic est false et si l'accesseur GET est non public ou si nonPublic est true mais qu'il n'existe pas d'accesseur GET.

Remarques

Pour obtenir le getter d’une propriété, réfléchissez au type parent de la propriété à l’aide de Type.GetType ou Assembly.GetType, récupérez l’objet de propriété Reflection à partir du type et appelez PropertyInfo.GetGetMethod.

S’applique à