FieldBuilder.IsDefined(Type, Boolean) Méthode

Définition

Indique si un attribut ayant le 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 ce champ sont définies ; sinon, false.

Exceptions

Cette méthode n’est actuellement pas prise en charge. Récupérez le champ à l’aide GetField(String, BindingFlags) et appelez IsDefined(Type, Boolean) sur le champ retourné FieldInfo.

S’applique à