DisablePrivateReflectionAttribute Clase

Definición

Precaución

DisablePrivateReflectionAttribute has no effect in .NET 6.0+.

Indica que cualquier miembro privado en los tipos de un ensamblado no está disponible para su reflexión.

public ref class DisablePrivateReflectionAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed class DisablePrivateReflectionAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
[System.Obsolete("DisablePrivateReflectionAttribute has no effect in .NET 6.0+.", DiagnosticId="SYSLIB0015", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class DisablePrivateReflectionAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)>]
type DisablePrivateReflectionAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)>]
[<System.Obsolete("DisablePrivateReflectionAttribute has no effect in .NET 6.0+.", DiagnosticId="SYSLIB0015", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type DisablePrivateReflectionAttribute = class
    inherit Attribute
Public NotInheritable Class DisablePrivateReflectionAttribute
Inherits Attribute
Herencia
DisablePrivateReflectionAttribute
Atributos

Comentarios

Nota

Los .NET Framework, .NET Core y los entornos de ejecución de .NET no aplican de forma coherente este atributo. Los desarrolladores no deben confiar en este atributo para restringir el acceso a los miembros no públicos de un ensamblado.

Normalmente, los métodos de reflexión, como Type.GetMethod o PropertyInfo.GetValue, se pueden usar para obtener información sobre los miembros privados en tiempo de ejecución. Cuando se aplica a un ensamblado, el atributo hace que la DisablePrivateReflectionAttribute información sobre los miembros privados de los tipos de ese ensamblado no esté disponible para la reflexión en tiempo de ejecución.

Constructores

DisablePrivateReflectionAttribute()

Inicializa una nueva instancia de la clase DisablePrivateReflectionAttribute.

Propiedades

TypeId

Cuando se implementa en una clase derivada, obtiene un identificador único para este Attribute.

(Heredado de Attribute)

Métodos

Equals(Object)

Devuelve un valor que indica si esta instancia es igual que un objeto especificado.

(Heredado de Attribute)
GetHashCode()

Devuelve el código hash de esta instancia.

(Heredado de Attribute)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
IsDefaultAttribute()

Si se reemplaza en una clase derivada, indica si el valor de esta instancia es el valor predeterminado de la clase derivada.

(Heredado de Attribute)
Match(Object)

Cuando se invalida en una clase derivada, devuelve un valor que indica si esta instancia es igual a un objeto especificado.

(Heredado de Attribute)
MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Implementaciones de interfaz explícitas

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Asigna un conjunto de nombres a un conjunto correspondiente de identificadores de envío.

(Heredado de Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Obtiene la información de tipos de un objeto, que puede utilizarse para obtener la información de tipos de una interfaz.

(Heredado de Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Recupera el número de interfaces de información de tipo que proporciona un objeto (0 ó 1).

(Heredado de Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Proporciona acceso a las propiedades y los métodos expuestos por un objeto.

(Heredado de Attribute)

Se aplica a