ConstructorBuilder.GetCustomAttributes Méthode

Définition

Retourne les attributs personnalisés définis pour ce constructeur.

Surcharges

GetCustomAttributes(Boolean)

Retourne tous les attributs personnalisés définis pour ce constructeur.

GetCustomAttributes(Type, Boolean)

Retourne les attributs personnalisés identifiés par le type donné.

GetCustomAttributes(Boolean)

Source:
ConstructorBuilder.cs

Retourne tous les attributs personnalisés définis pour ce constructeur.

public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(bool inherit);
public override object[] GetCustomAttributes (bool inherit);
override this.GetCustomAttributes : bool -> obj[]
Public Overrides Function GetCustomAttributes (inherit As Boolean) As Object()

Paramètres

inherit
Boolean

Contrôle l’héritage des attributs personnalisés à partir de classes de base. Ce paramètre est ignoré.

Retours

Object[]

Tableau d’objets représentant tous les attributs personnalisés du constructeur représenté par cette instance ConstructorBuilder.

Exceptions

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

Remarques

Le inherit paramètre est ignoré, car une classe n’hérite jamais des constructeurs des classes de base.

Pour obtenir les attributs personnalisés, terminez la génération du type en appelant CreateType, récupérez le constructeur en appelant la GetConstructor méthode sur le type retourné, puis appelez la GetCustomAttributes méthode sur le retourné ConstructorInfo.

S’applique à

GetCustomAttributes(Type, Boolean)

Source:
ConstructorBuilder.cs

Retourne les attributs personnalisés identifiés par le type donné.

public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(Type ^ attributeType, bool inherit);
public override object[] GetCustomAttributes (Type attributeType, bool inherit);
override this.GetCustomAttributes : Type * bool -> obj[]
Public Overrides Function GetCustomAttributes (attributeType As Type, inherit As Boolean) As Object()

Paramètres

attributeType
Type

Type d’attribut personnalisé.

inherit
Boolean

Contrôle l’héritage des attributs personnalisés à partir de classes de base. Ce paramètre est ignoré.

Retours

Object[]

Tableau d’objets qui représente les attributs de ce constructeur.

Exceptions

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

Remarques

Le inherit paramètre est ignoré, car une classe n’hérite jamais des constructeurs des classes de base.

Pour obtenir les attributs personnalisés, terminez la génération du type en appelant CreateType, récupérez le constructeur en appelant la GetConstructor méthode sur le type retourné, puis appelez la GetCustomAttributes méthode sur le retourné ConstructorInfo.

S’applique à