FieldBuilder.IsDefined(Type, Boolean) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Indique si un attribut doté du type spécifié est défini sur un champ.
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
Type de l'attribut.
- inherit
- Boolean
Contrôle l’héritage des attributs personnalisés à partir de classes de base.
Retours
true
si une ou plusieurs instances de attributeType
sont définies sur ce champ ; sinon false
.
Exceptions
Cette méthode n’est pas prise en charge pour l’instant. Vous pouvez récupérer le champ à l'aide de GetField(String, BindingFlags) et appeler IsDefined(Type, Boolean) sur le FieldInfo retourné.
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de l’année 2024, nous abandonnerons progressivement le mécanisme de retour d’information GitHub Issues pour le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez :Soumettre et afficher des commentaires pour