Partager via


Utility.GetCustomAttributes(Type, Type, Boolean) Méthode

Définition

En cas de substitution dans une classe dérivée, retourne un tableau d’attributs personnalisés appliqués à ce membre et identifiés par System.Type.

public static System.Collections.Generic.IEnumerable<object> GetCustomAttributes (Type type, Type attributeType, bool inherit);
static member GetCustomAttributes : Type * Type * bool -> seq<obj>
Public Shared Function GetCustomAttributes (type As Type, attributeType As Type, inherit As Boolean) As IEnumerable(Of Object)

Paramètres

type
Type

Type sur lequel interroger des attributs personnalisés.

attributeType
Type

Type d’attribut à rechercher. Seuls les attributs qui peuvent être assigné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. Ce paramètre est ignoré pour les propriétés et les événements ; consultez la section Notes.

Retours

Un IEnumerable<T> d’attributs personnalisés appliqués à ce membre, ou un tableau avec zéro élément si aucun attribut assignable à attributeType n’a été appliqué.

S’applique à