PropertyBuilder.IsDefined(Type, Boolean) Méthode

Définition

Indique si une ou plusieurs instances sont attributeType définies sur cette propriété.

public:
 override bool IsDefined(Type ^ attributeType, bool inherit);
public override bool IsDefined(Type attributeType, bool inherit);
override this.IsDefined : Type * bool -> bool
Public Overrides Function IsDefined (attributeType As Type, inherit As Boolean) As Boolean

Paramètres

attributeType
Type

Objet Type auquel les attributs personnalisés sont appliqués.

inherit
Boolean

Spécifie s’il faut parcourir la chaîne d’héritage de cette propriété pour rechercher les attributs personnalisés.

Retours

true si une ou plusieurs instances sont attributeType définies sur cette propriété ; sinon false.

Exceptions

Cette méthode n’est pas prise en charge.

Remarques

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

S’applique à