CustomAttributeExtensions.GetCustomAttributes Método
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Recupera una colección de atributos personalizados que se aplican a un elemento especificado.
GetCustomAttributes(ParameterInfo, Type, Boolean) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un parámetro concreto y, opcionalmente, inspecciona los antecesores de dicho parámetro. |
GetCustomAttributes(MemberInfo, Type, Boolean) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro. |
GetCustomAttributes(ParameterInfo, Type) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un parámetro concreto. |
GetCustomAttributes(ParameterInfo, Boolean) |
Recupera una colección de atributos personalizados que se aplican a un parámetro concreto y, opcionalmente, inspecciona los antecesores de dicho parámetro. |
GetCustomAttributes(Module, Type) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un módulo concreto. |
GetCustomAttributes(MemberInfo, Type) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto. |
GetCustomAttributes(MemberInfo, Boolean) |
Recupera una colección de atributos personalizados que se aplican a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro. |
GetCustomAttributes(Assembly, Type) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un ensamblado concreto. |
GetCustomAttributes(ParameterInfo) |
Recupera una colección de atributos personalizados que se aplican a un parámetro especificado. |
GetCustomAttributes(Module) |
Recupera una colección de atributos personalizados que se aplican a un módulo especificado. |
GetCustomAttributes(MemberInfo) |
Recupera una colección de atributos personalizados que se aplican a un miembro especificado. |
GetCustomAttributes(Assembly) |
Recupera una colección de atributos personalizados que se aplican a un ensamblado especificado. |
GetCustomAttributes<T>(ParameterInfo, Boolean) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un parámetro concreto y, opcionalmente, inspecciona los antecesores de dicho parámetro. |
GetCustomAttributes<T>(MemberInfo, Boolean) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro. |
GetCustomAttributes<T>(ParameterInfo) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un parámetro concreto. |
GetCustomAttributes<T>(MemberInfo) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto. |
GetCustomAttributes<T>(Assembly) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un ensamblado concreto. |
GetCustomAttributes<T>(Module) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un módulo concreto. |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un parámetro concreto y, opcionalmente, inspecciona los antecesores de dicho parámetro.
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)
Parámetros
- element
- ParameterInfo
Parámetro que se va a inspeccionar.
- attributeType
- Type
El tipo de atributo que se va a buscar.
- inherit
- Boolean
Es true
para inspeccionar los antecesores de element
; de lo contrario, es false
.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con attributeType
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
o attributeType
es null
.
attributeType
no se deriva de Attribute.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro.
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)
Parámetros
- element
- MemberInfo
Miembro que se va a inspeccionar.
- attributeType
- Type
El tipo de atributo que se va a buscar.
- inherit
- Boolean
Es true
para inspeccionar los antecesores de element
; de lo contrario, es false
.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con attributeType
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
o attributeType
es null
.
attributeType
no se deriva de Attribute.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un parámetro concreto.
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)
Parámetros
- element
- ParameterInfo
Parámetro que se va a inspeccionar.
- attributeType
- Type
El tipo de atributo que se va a buscar.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con attributeType
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
o attributeType
es null
.
attributeType
no se deriva de Attribute.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados que se aplican a un parámetro concreto y, opcionalmente, inspecciona los antecesores de dicho parámetro.
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)
Parámetros
- element
- ParameterInfo
Parámetro que se va a inspeccionar.
- inherit
- Boolean
Es true
para inspeccionar los antecesores de element
; de lo contrario, es false
.
Devoluciones
Colección de atributos personalizados que se aplican a element
o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un módulo concreto.
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)
Parámetros
- element
- Module
Módulo que se va a inspeccionar.
- attributeType
- Type
El tipo de atributo que se va a buscar.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con attributeType
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
o attributeType
es null
.
attributeType
no se deriva de Attribute.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto.
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)
Parámetros
- element
- MemberInfo
Miembro que se va a inspeccionar.
- attributeType
- Type
El tipo de atributo que se va a buscar.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con attributeType
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
o attributeType
es null
.
attributeType
no se deriva de Attribute.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados que se aplican a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro.
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)
Parámetros
- element
- MemberInfo
Miembro que se va a inspeccionar.
- inherit
- Boolean
Es true
para inspeccionar los antecesores de element
; de lo contrario, es false
.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coincide con los criterios especificados, o una colección vacía si no hay tales atributos.
Excepciones
element
es null
.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un ensamblado concreto.
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)
Parámetros
- element
- Assembly
Ensamblado que se va a inspeccionar.
- attributeType
- Type
El tipo de atributo que se va a buscar.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con attributeType
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
o attributeType
es null
.
attributeType
no se deriva de Attribute.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados que se aplican a un parámetro especificado.
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)
Parámetros
- element
- ParameterInfo
Parámetro que se va a inspeccionar.
Devoluciones
Colección de atributos personalizados que se aplican a element
o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados que se aplican a un módulo especificado.
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)
Parámetros
- element
- Module
Módulo que se va a inspeccionar.
Devoluciones
Colección de atributos personalizados que se aplican a element
o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados que se aplican a un miembro especificado.
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)
Parámetros
- element
- MemberInfo
Miembro que se va a inspeccionar.
Devoluciones
Colección de atributos personalizados que se aplican a element
o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados que se aplican a un ensamblado especificado.
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)
Parámetros
- element
- Assembly
Ensamblado que se va a inspeccionar.
Devoluciones
Colección de atributos personalizados que se aplican a element
o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un parámetro concreto y, opcionalmente, inspecciona los antecesores de dicho parámetro.
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)
Parámetros de tipo
- T
El tipo de atributo que se va a buscar.
Parámetros
- element
- ParameterInfo
Parámetro que se va a inspeccionar.
- inherit
- Boolean
Es true
para inspeccionar los antecesores de element
; de lo contrario, es false
.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con T
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro.
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)
Parámetros de tipo
- T
El tipo de atributo que se va a buscar.
Parámetros
- element
- MemberInfo
Miembro que se va a inspeccionar.
- inherit
- Boolean
Es true
para inspeccionar los antecesores de element
; de lo contrario, es false
.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con T
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un parámetro concreto.
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)
Parámetros de tipo
- T
El tipo de atributo que se va a buscar.
Parámetros
- element
- ParameterInfo
Parámetro que se va a inspeccionar.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con T
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto.
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)
Parámetros de tipo
- T
El tipo de atributo que se va a buscar.
Parámetros
- element
- MemberInfo
Miembro que se va a inspeccionar.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con T
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
element
no es un constructor, método, propiedad, evento, tipo o campo.
No se puede cargar un tipo de atributo personalizado.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un ensamblado concreto.
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)
Parámetros de tipo
- T
El tipo de atributo que se va a buscar.
Parámetros
- element
- Assembly
Ensamblado que se va a inspeccionar.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con T
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
- Source:
- CustomAttributeExtensions.cs
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un módulo concreto.
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)
Parámetros de tipo
- T
El tipo de atributo que se va a buscar.
Parámetros
- element
- Module
Módulo que se va a inspeccionar.
Devoluciones
Colección de atributos personalizados que se aplican a element
y que coinciden con T
, o una colección vacía si no existe ninguno de esos atributos.
Excepciones
element
es null
.
Se aplica a
.NET 9 y otras versiones
Producto | Versiones |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Comentarios de .NET
.NET es un proyecto de código abierto. Seleccione un vínculo para proporcionar comentarios: