CustomAttributeExtensions.GetCustomAttributes Méthode

Définition

Récupère une collection d’attributs personnalisés appliqués à un élément spécifié.

Surcharges

Nom Description
GetCustomAttributes(ParameterInfo, Type, Boolean)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un paramètre spécifié et inspecte éventuellement les ancêtres de ce paramètre.

GetCustomAttributes(MemberInfo, Type, Boolean)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un membre spécifié et inspecte éventuellement les ancêtres de ce membre.

GetCustomAttributes(ParameterInfo, Type)

Récupère une collection d’attributs personnalisés d’un type spécifié appliqué à un paramètre spécifié.

GetCustomAttributes(ParameterInfo, Boolean)

Récupère une collection d’attributs personnalisés appliqués à un paramètre spécifié et inspecte éventuellement les ancêtres de ce paramètre.

GetCustomAttributes(Module, Type)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un module spécifié.

GetCustomAttributes(MemberInfo, Type)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un membre spécifié.

GetCustomAttributes(MemberInfo, Boolean)

Récupère une collection d’attributs personnalisés appliqués à un membre spécifié et inspecte éventuellement les ancêtres de ce membre.

GetCustomAttributes(Assembly, Type)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un assembly spécifié.

GetCustomAttributes(ParameterInfo)

Récupère une collection d’attributs personnalisés appliqués à un paramètre spécifié.

GetCustomAttributes(Module)

Récupère une collection d’attributs personnalisés appliqués à un module spécifié.

GetCustomAttributes(MemberInfo)

Récupère une collection d’attributs personnalisés appliqués à un membre spécifié.

GetCustomAttributes(Assembly)

Récupère une collection d’attributs personnalisés appliqués à un assembly spécifié.

GetCustomAttributes<T>(ParameterInfo, Boolean)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un paramètre spécifié et inspecte éventuellement les ancêtres de ce paramètre.

GetCustomAttributes<T>(MemberInfo, Boolean)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un membre spécifié et inspecte éventuellement les ancêtres de ce membre.

GetCustomAttributes<T>(ParameterInfo)

Récupère une collection d’attributs personnalisés d’un type spécifié appliqué à un paramètre spécifié.

GetCustomAttributes<T>(MemberInfo)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un membre spécifié.

GetCustomAttributes<T>(Assembly)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un assembly spécifié.

GetCustomAttributes<T>(Module)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un module spécifié.

GetCustomAttributes(ParameterInfo, Type, Boolean)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un paramètre spécifié et inspecte éventuellement les ancêtres de ce paramètre.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, Type ^ attributeType, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element, Type attributeType, bool inherit);
static member GetCustomAttributes : System.Reflection.ParameterInfo * Type * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo, attributeType As Type, inherit As Boolean) As IEnumerable(Of Attribute)

Paramètres

element
ParameterInfo

Paramètre à inspecter.

attributeType
Type

Type d’attribut à rechercher.

inherit
Boolean

true pour inspecter les ancêtres de element; sinon, false.

Retours

Collection des attributs personnalisés appliqués et element correspondants attributeType, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element ou attributeType est null.

attributeType n’est pas dérivé de Attribute.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes(MemberInfo, Type, Boolean)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un membre spécifié et inspecte éventuellement les ancêtres de ce membre.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, Type ^ attributeType, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element, Type attributeType, bool inherit);
static member GetCustomAttributes : System.Reflection.MemberInfo * Type * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo, attributeType As Type, inherit As Boolean) As IEnumerable(Of Attribute)

Paramètres

element
MemberInfo

Membre à inspecter.

attributeType
Type

Type d’attribut à rechercher.

inherit
Boolean

true pour inspecter les ancêtres de element; sinon, false.

Retours

Collection des attributs personnalisés appliqués et element correspondants attributeType, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element ou attributeType est null.

attributeType n’est pas dérivé de Attribute.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes(ParameterInfo, Type)

Récupère une collection d’attributs personnalisés d’un type spécifié appliqué à un paramètre spécifié.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element, Type attributeType);
static member GetCustomAttributes : System.Reflection.ParameterInfo * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo, attributeType As Type) As IEnumerable(Of Attribute)

Paramètres

element
ParameterInfo

Paramètre à inspecter.

attributeType
Type

Type d’attribut à rechercher.

Retours

Collection des attributs personnalisés appliqués et element correspondants attributeType, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element ou attributeType est null.

attributeType n’est pas dérivé de Attribute.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes(ParameterInfo, Boolean)

Récupère une collection d’attributs personnalisés appliqués à un paramètre spécifié et inspecte éventuellement les ancêtres de ce paramètre.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element, bool inherit);
static member GetCustomAttributes : System.Reflection.ParameterInfo * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo, inherit As Boolean) As IEnumerable(Of Attribute)

Paramètres

element
ParameterInfo

Paramètre à inspecter.

inherit
Boolean

true pour inspecter les ancêtres de element; sinon, false.

Retours

Collection des attributs personnalisés appliqués à elementune collection vide si aucun attribut de ce type n’existe.

Exceptions

element a la valeur null.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes(Module, Type)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un module spécifié.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Module ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.Module element, Type attributeType);
static member GetCustomAttributes : System.Reflection.Module * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Module, attributeType As Type) As IEnumerable(Of Attribute)

Paramètres

element
Module

Module à inspecter.

attributeType
Type

Type d’attribut à rechercher.

Retours

Collection des attributs personnalisés appliqués et element correspondants attributeType, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element ou attributeType est null.

attributeType n’est pas dérivé de Attribute.

S’applique à

GetCustomAttributes(MemberInfo, Type)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un membre spécifié.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element, Type attributeType);
static member GetCustomAttributes : System.Reflection.MemberInfo * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo, attributeType As Type) As IEnumerable(Of Attribute)

Paramètres

element
MemberInfo

Membre à inspecter.

attributeType
Type

Type d’attribut à rechercher.

Retours

Collection des attributs personnalisés appliqués et element correspondants attributeType, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element ou attributeType est null.

attributeType n’est pas dérivé de Attribute.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes(MemberInfo, Boolean)

Récupère une collection d’attributs personnalisés appliqués à un membre spécifié et inspecte éventuellement les ancêtres de ce membre.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element, bool inherit);
static member GetCustomAttributes : System.Reflection.MemberInfo * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo, inherit As Boolean) As IEnumerable(Of Attribute)

Paramètres

element
MemberInfo

Membre à inspecter.

inherit
Boolean

true pour inspecter les ancêtres de element; sinon, false.

Retours

Collection des attributs personnalisés appliqués à element ces critères, ou collection vide si aucun de ces attributs n’existe.

Exceptions

element a la valeur null.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes(Assembly, Type)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un assembly spécifié.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Assembly ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.Assembly element, Type attributeType);
static member GetCustomAttributes : System.Reflection.Assembly * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Assembly, attributeType As Type) As IEnumerable(Of Attribute)

Paramètres

element
Assembly

Assembly à inspecter.

attributeType
Type

Type d’attribut à rechercher.

Retours

Collection des attributs personnalisés appliqués et element correspondants attributeType, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element ou attributeType est null.

attributeType n’est pas dérivé de Attribute.

S’applique à

GetCustomAttributes(ParameterInfo)

Récupère une collection d’attributs personnalisés appliqués à un paramètre spécifié.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element);
static member GetCustomAttributes : System.Reflection.ParameterInfo -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo) As IEnumerable(Of Attribute)

Paramètres

element
ParameterInfo

Paramètre à inspecter.

Retours

Collection des attributs personnalisés appliqués à elementune collection vide si aucun attribut de ce type n’existe.

Exceptions

element a la valeur null.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes(Module)

Récupère une collection d’attributs personnalisés appliqués à un module spécifié.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Module ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.Module element);
static member GetCustomAttributes : System.Reflection.Module -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Module) As IEnumerable(Of Attribute)

Paramètres

element
Module

Module à inspecter.

Retours

Collection des attributs personnalisés appliqués à elementune collection vide si aucun attribut de ce type n’existe.

Exceptions

element a la valeur null.

S’applique à

GetCustomAttributes(MemberInfo)

Récupère une collection d’attributs personnalisés appliqués à un membre spécifié.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element);
static member GetCustomAttributes : System.Reflection.MemberInfo -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo) As IEnumerable(Of Attribute)

Paramètres

element
MemberInfo

Membre à inspecter.

Retours

Collection des attributs personnalisés appliqués à elementune collection vide si aucun attribut de ce type n’existe.

Exceptions

element a la valeur null.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes(Assembly)

Récupère une collection d’attributs personnalisés appliqués à un assembly spécifié.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Assembly ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes(this System.Reflection.Assembly element);
static member GetCustomAttributes : System.Reflection.Assembly -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Assembly) As IEnumerable(Of Attribute)

Paramètres

element
Assembly

Assembly à inspecter.

Retours

Collection des attributs personnalisés appliqués à elementune collection vide si aucun attribut de ce type n’existe.

Exceptions

element a la valeur null.

S’applique à

GetCustomAttributes<T>(ParameterInfo, Boolean)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un paramètre spécifié et inspecte éventuellement les ancêtres de ce paramètre.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.ParameterInfo element, bool inherit) where T : Attribute;
static member GetCustomAttributes : System.Reflection.ParameterInfo * bool -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As ParameterInfo, inherit As Boolean) As IEnumerable(Of T)

Paramètres de type

T

Type d’attribut à rechercher.

Paramètres

element
ParameterInfo

Paramètre à inspecter.

inherit
Boolean

true pour inspecter les ancêtres de element; sinon, false.

Retours

Collection des attributs personnalisés appliqués et element correspondants T, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element a la valeur null.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes<T>(MemberInfo, Boolean)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un membre spécifié et inspecte éventuellement les ancêtres de ce membre.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.MemberInfo element, bool inherit) where T : Attribute;
static member GetCustomAttributes : System.Reflection.MemberInfo * bool -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As MemberInfo, inherit As Boolean) As IEnumerable(Of T)

Paramètres de type

T

Type d’attribut à rechercher.

Paramètres

element
MemberInfo

Membre à inspecter.

inherit
Boolean

true pour inspecter les ancêtres de element; sinon, false.

Retours

Collection des attributs personnalisés appliqués et element correspondants T, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element a la valeur null.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes<T>(ParameterInfo)

Récupère une collection d’attributs personnalisés d’un type spécifié appliqué à un paramètre spécifié.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.ParameterInfo element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.ParameterInfo -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As ParameterInfo) As IEnumerable(Of T)

Paramètres de type

T

Type d’attribut à rechercher.

Paramètres

element
ParameterInfo

Paramètre à inspecter.

Retours

Collection des attributs personnalisés appliqués et element correspondants T, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element a la valeur null.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes<T>(MemberInfo)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un membre spécifié.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.MemberInfo element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.MemberInfo -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As MemberInfo) As IEnumerable(Of T)

Paramètres de type

T

Type d’attribut à rechercher.

Paramètres

element
MemberInfo

Membre à inspecter.

Retours

Collection des attributs personnalisés appliqués et element correspondants T, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element a la valeur null.

element n’est pas un constructeur, une méthode, une propriété, un événement, un type ou un champ.

Impossible de charger un type d’attribut personnalisé.

S’applique à

GetCustomAttributes<T>(Assembly)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un assembly spécifié.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::Assembly ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.Assembly element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.Assembly -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As Assembly) As IEnumerable(Of T)

Paramètres de type

T

Type d’attribut à rechercher.

Paramètres

element
Assembly

Assembly à inspecter.

Retours

Collection des attributs personnalisés appliqués et element correspondants T, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element a la valeur null.

S’applique à

GetCustomAttributes<T>(Module)

Récupère une collection d’attributs personnalisés d’un type spécifié qui sont appliqués à un module spécifié.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::Module ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.Module element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.Module -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As Module) As IEnumerable(Of T)

Paramètres de type

T

Type d’attribut à rechercher.

Paramètres

element
Module

Module à inspecter.

Retours

Collection des attributs personnalisés appliqués et element correspondants T, ou une collection vide si aucun de ces attributs n’existe.

Exceptions

element a la valeur null.

S’applique à