_MethodBase.GetCustomAttributes 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.
Fournit aux objets COM un accès indépendant de la version à la GetCustomAttributes méthode.
Surcharges
| Nom | Description |
|---|---|
| GetCustomAttributes(Boolean) |
Fournit aux objets COM un accès indépendant de la version à la GetCustomAttributes(Boolean) méthode. |
| GetCustomAttributes(Type, Boolean) |
Fournit aux objets COM un accès indépendant de la version à la GetCustomAttributes(Type, Boolean) méthode. |
Remarques
Cette méthode permet d’accéder aux classes managées à partir de code non managé et ne doit pas être appelée à partir du code managé.
Les GetCustomAttributes membres retournent tous les attributs appliqués à ce membre.
GetCustomAttributes(Boolean)
Fournit aux objets COM un accès indépendant de la version à la GetCustomAttributes(Boolean) méthode.
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
true pour rechercher les attributs dans la chaîne d’héritage de ce membre ; sinon, false.
Retours
Tableau qui contient tous les attributs personnalisés ou un tableau avec zéro (0) éléments si aucun attribut n’est défini.
Remarques
Cette méthode permet d’accéder aux classes managées à partir de code non managé et ne doit pas être appelée à partir du code managé.
La GetCustomAttributes méthode retourne un tableau contenant tous les attributs personnalisés.
S’applique à
GetCustomAttributes(Type, Boolean)
Fournit aux objets COM un accès indépendant de la version à la GetCustomAttributes(Type, Boolean) méthode.
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 d’attribut à rechercher. Seuls les attributs pouvant être affectés à ce type sont retournés.
- inherit
- Boolean
true pour rechercher les attributs dans la chaîne d’héritage de ce membre ; sinon, false.
Retours
Tableau d’attributs personnalisés appliqués à ce membre ou tableau avec zéro (0) éléments si aucun attribut n’a été appliqué.
Remarques
Cette méthode permet d’accéder aux classes managées à partir de code non managé et ne doit pas être appelée à partir du code managé.
La GetCustomAttributes méthode retourne un tableau d’attributs personnalisés identifiés par Type.