PropertyBuilder.GetCustomAttributes Méthode

Définition

Retourne tous les attributs personnalisés définis sur cette propriété.

Surcharges

Nom Description
GetCustomAttributes(Boolean)

Retourne un tableau de tous les attributs personnalisés pour cette propriété.

GetCustomAttributes(Type, Boolean)

Retourne un tableau d’attributs personnalisés identifiés par Type.

GetCustomAttributes(Boolean)

Retourne un tableau de tous les attributs personnalisés pour cette propriété.

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

Si true, guide la chaîne d’héritage de cette propriété pour rechercher les attributs personnalisés.

Retours

Object[]

Tableau de tous les attributs personnalisés.

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

S’applique à

GetCustomAttributes(Type, Boolean)

Retourne un tableau d’attributs personnalisés identifiés par Type.

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

Tableau d’attributs personnalisés identifiés par type.

inherit
Boolean

Si true, guide la chaîne d’héritage de cette propriété pour rechercher les attributs personnalisés.

Retours

Object[]

Tableau d’attributs personnalisés définis sur ce membre réfléchi, ou null si aucun attribut n’est défini sur ce membre.

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

S’applique à