EnumBuilder.IsDefined(Type, Boolean) Méthode

Définition

Vérifie si le type d’attribut personnalisé spécifié est défini.

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 rechercher les attributs dans la chaîne d’héritage de ce membre.

Retours

Boolean

true si une ou plusieurs instances de attributeType sont définies sur ce membre ; sinon, false.

Exceptions

Cette méthode n’est actuellement pas prise en charge pour les types incomplets.

Remarques

Pour contourner ce problème, vérifiez si un attribut personnalisé est défini pour un type terminé, récupérez le type à l’aide GetType et appelez GetCustomAttributes le retour Type.

S’applique à