CustomAttributeExtensions.GetCustomAttributes Metodo

Definizione

Recupera una raccolta di attributi personalizzati che vengono applicati a un elemento specificato.

Overload

GetCustomAttributes(ParameterInfo, Type, Boolean)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un parametro specificato e verifica facoltativamente i predecessori di tale parametro.

GetCustomAttributes(MemberInfo, Type, Boolean)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un membro specificato e verifica facoltativamente i predecessori di tale membro.

GetCustomAttributes(ParameterInfo, Type)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un parametro specificato.

GetCustomAttributes(ParameterInfo, Boolean)

Recupera una raccolta di attributi personalizzati che vengono applicati a un parametro specificato e verifica facoltativamente i predecessori di tale parametro.

GetCustomAttributes(Module, Type)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un modulo specificato.

GetCustomAttributes(MemberInfo, Type)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un membro specificato.

GetCustomAttributes(MemberInfo, Boolean)

Recupera una raccolta di attributi personalizzati che vengono applicati a un membro specificato e verifica facoltativamente i predecessori di tale membro.

GetCustomAttributes(Assembly, Type)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un assembly specificato.

GetCustomAttributes(ParameterInfo)

Recupera una raccolta di attributi personalizzati che vengono applicati a un parametro specificato.

GetCustomAttributes(Module)

Recupera una raccolta di attributi personalizzati che vengono applicati a un modulo specificato.

GetCustomAttributes(MemberInfo)

Recupera una raccolta di attributi personalizzati che vengono applicati a un membro specificato.

GetCustomAttributes(Assembly)

Recupera una raccolta di attributi personalizzati che vengono applicati a un assembly specificato.

GetCustomAttributes<T>(ParameterInfo, Boolean)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un parametro specificato e verifica facoltativamente i predecessori di tale parametro.

GetCustomAttributes<T>(MemberInfo, Boolean)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un membro specificato e verifica facoltativamente i predecessori di tale membro.

GetCustomAttributes<T>(ParameterInfo)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un parametro specificato.

GetCustomAttributes<T>(MemberInfo)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un membro specificato.

GetCustomAttributes<T>(Assembly)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un assembly specificato.

GetCustomAttributes<T>(Module)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un modulo specificato.

GetCustomAttributes(ParameterInfo, Type, Boolean)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un parametro specificato e verifica facoltativamente i predecessori di tale parametro.

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)

Parametri

element
ParameterInfo

Il parametro da ispezionare.

attributeType
Type

Tipo di attributo da cercare.

inherit
Boolean

true per ispezionare i predecessori di element; in caso contrario, false.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element e corrispondenti a attributeType o raccolta vuota se tali attributi non esistono.

Eccezioni

element o attributeType è null.

attributeType non deriva da Attribute.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes(MemberInfo, Type, Boolean)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un membro specificato e verifica facoltativamente i predecessori di tale membro.

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)

Parametri

element
MemberInfo

Il membro da ispezionare.

attributeType
Type

Tipo di attributo da cercare.

inherit
Boolean

true per ispezionare i predecessori di element; in caso contrario, false.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element e corrispondenti a attributeType o raccolta vuota se tali attributi non esistono.

Eccezioni

element o attributeType è null.

attributeType non deriva da Attribute.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes(ParameterInfo, Type)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un parametro specificato.

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)

Parametri

element
ParameterInfo

Il parametro da ispezionare.

attributeType
Type

Tipo di attributo da cercare.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element e corrispondenti a attributeType o raccolta vuota se tali attributi non esistono.

Eccezioni

element o attributeType è null.

attributeType non deriva da Attribute.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes(ParameterInfo, Boolean)

Recupera una raccolta di attributi personalizzati che vengono applicati a un parametro specificato e verifica facoltativamente i predecessori di tale parametro.

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)

Parametri

element
ParameterInfo

Il parametro da ispezionare.

inherit
Boolean

true per ispezionare i predecessori di element; in caso contrario, false.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes(Module, Type)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un modulo specificato.

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)

Parametri

element
Module

Modulo da controllare.

attributeType
Type

Tipo di attributo da cercare.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element e corrispondenti a attributeType o raccolta vuota se tali attributi non esistono.

Eccezioni

element o attributeType è null.

attributeType non deriva da Attribute.

Si applica a

GetCustomAttributes(MemberInfo, Type)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un membro specificato.

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)

Parametri

element
MemberInfo

Il membro da ispezionare.

attributeType
Type

Tipo di attributo da cercare.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element e corrispondenti a attributeType o raccolta vuota se tali attributi non esistono.

Eccezioni

element o attributeType è null.

attributeType non deriva da Attribute.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes(MemberInfo, Boolean)

Recupera una raccolta di attributi personalizzati che vengono applicati a un membro specificato e verifica facoltativamente i predecessori di tale membro.

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)

Parametri

element
MemberInfo

Il membro da ispezionare.

inherit
Boolean

true per ispezionare i predecessori di element; in caso contrario, false.

Restituisce

IEnumerable<Attribute>

Raccolta degli attributi personalizzati applicati a element e che corrispondono ai criteri specificati oppure a una matrice vuota se non sono presenti tali attributi.

Eccezioni

element è null.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes(Assembly, Type)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un assembly specificato.

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)

Parametri

element
Assembly

L'assembly da ispezionare.

attributeType
Type

Tipo di attributo da cercare.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element e corrispondenti a attributeType o raccolta vuota se tali attributi non esistono.

Eccezioni

element o attributeType è null.

attributeType non deriva da Attribute.

Si applica a

GetCustomAttributes(ParameterInfo)

Recupera una raccolta di attributi personalizzati che vengono applicati a un parametro specificato.

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)

Parametri

element
ParameterInfo

Il parametro da ispezionare.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes(Module)

Recupera una raccolta di attributi personalizzati che vengono applicati a un modulo specificato.

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)

Parametri

element
Module

Modulo da controllare.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

Si applica a

GetCustomAttributes(MemberInfo)

Recupera una raccolta di attributi personalizzati che vengono applicati a un membro specificato.

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)

Parametri

element
MemberInfo

Il membro da ispezionare.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes(Assembly)

Recupera una raccolta di attributi personalizzati che vengono applicati a un assembly specificato.

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)

Parametri

element
Assembly

L'assembly da ispezionare.

Restituisce

IEnumerable<Attribute>

Raccolta di attributi personalizzati applicati a element o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

Si applica a

GetCustomAttributes<T>(ParameterInfo, Boolean)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un parametro specificato e verifica facoltativamente i predecessori di tale parametro.

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)

Parametri di tipo

T

Tipo di attributo da cercare.

Parametri

element
ParameterInfo

Il parametro da ispezionare.

inherit
Boolean

true per ispezionare i predecessori di element; in caso contrario, false.

Restituisce

IEnumerable<T>

Raccolta di attributi personalizzati applicati a element e corrispondenti a T o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes<T>(MemberInfo, Boolean)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un membro specificato e verifica facoltativamente i predecessori di tale membro.

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)

Parametri di tipo

T

Tipo di attributo da cercare.

Parametri

element
MemberInfo

Il membro da ispezionare.

inherit
Boolean

true per ispezionare i predecessori di element; in caso contrario, false.

Restituisce

IEnumerable<T>

Raccolta di attributi personalizzati applicati a element e corrispondenti a T o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes<T>(ParameterInfo)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un parametro specificato.

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)

Parametri di tipo

T

Tipo di attributo da cercare.

Parametri

element
ParameterInfo

Il parametro da ispezionare.

Restituisce

IEnumerable<T>

Raccolta di attributi personalizzati applicati a element e corrispondenti a T o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes<T>(MemberInfo)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un membro specificato.

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)

Parametri di tipo

T

Tipo di attributo da cercare.

Parametri

element
MemberInfo

Il membro da ispezionare.

Restituisce

IEnumerable<T>

Raccolta di attributi personalizzati applicati a element e corrispondenti a T o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

element non è un costruttore, un metodo, una proprietà, un evento, un tipo o un campo.

Non è possibile caricare un tipo di attributo personalizzato.

Si applica a

GetCustomAttributes<T>(Assembly)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un assembly specificato.

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)

Parametri di tipo

T

Tipo di attributo da cercare.

Parametri

element
Assembly

L'assembly da ispezionare.

Restituisce

IEnumerable<T>

Raccolta di attributi personalizzati applicati a element e corrispondenti a T o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

Si applica a

GetCustomAttributes<T>(Module)

Recupera una raccolta di attributi personalizzati di un tipo specificato che vengono applicati a un modulo specificato.

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)

Parametri di tipo

T

Tipo di attributo da cercare.

Parametri

element
Module

Modulo da controllare.

Restituisce

IEnumerable<T>

Raccolta di attributi personalizzati applicati a element e corrispondenti a T o raccolta vuota se tali attributi non esistono.

Eccezioni

element è null.

Si applica a