ICustomAttributeProvider.GetCustomAttributes Méthode

Définition

Retourne des attributs personnalisés définis sur ce membre.

Surcharges

Nom Description
GetCustomAttributes(Boolean)

Retourne un tableau de tous les attributs personnalisés définis sur ce membre, à l’exclusion des attributs nommés ou d’un tableau vide s’il n’existe aucun attribut personnalisé.

GetCustomAttributes(Type, Boolean)

Retourne un tableau d’attributs personnalisés définis sur ce membre, identifiés par type ou un tableau vide s’il n’existe aucun attribut personnalisé de ce type.

GetCustomAttributes(Boolean)

Retourne un tableau de tous les attributs personnalisés définis sur ce membre, à l’exclusion des attributs nommés ou d’un tableau vide s’il n’existe aucun attribut personnalisé.

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

Paramètres

inherit
Boolean

Quand true, recherchez la chaîne de hiérarchie pour l’attribut personnalisé hérité.

Retours

Object[]

Tableau d’objets représentant des attributs personnalisés ou un tableau vide.

Exceptions

Impossible de charger le type d’attribut personnalisé.

Remarques

L’appel ICustomAttributeProvider.GetCustomAttributes ou PropertyInfoEventInfo le moment où le inherit paramètre de GetCustomAttributes ce true paramètre ne marche pas dans la hiérarchie de type. Permet System.Attribute d’hériter des attributs personnalisés.

Cette méthode retourne des attributs personnalisés définis directement sur un membre non hérité uniquement.

S’applique à

GetCustomAttributes(Type, Boolean)

Retourne un tableau d’attributs personnalisés définis sur ce membre, identifiés par type ou un tableau vide s’il n’existe aucun attribut personnalisé de ce type.

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

Paramètres

attributeType
Type

Type des attributs personnalisés.

inherit
Boolean

Quand true, recherchez la chaîne de hiérarchie pour l’attribut personnalisé hérité.

Retours

Object[]

Tableau d’objets représentant des attributs personnalisés ou un tableau vide.

Exceptions

Impossible de charger le type d’attribut personnalisé.

attributeType a la valeur null.

Remarques

S’il attributeType s’agit d’une classe de base ou d’une interface, cette méthode retourne n’importe quelle implémentation de ce type.

Cette méthode retourne des attributs personnalisés définis directement sur un membre non hérité uniquement.

L’appel ICustomAttributeProvider.GetCustomAttributes ou PropertyInfoEventInfo le moment où le inherit paramètre de GetCustomAttributes ce true paramètre ne marche pas dans la hiérarchie de type. Permet System.Attribute d’hériter des attributs personnalisés.

S’applique à