DisablePrivateReflectionAttribute Classe

Definizione

Attenzione

DisablePrivateReflectionAttribute has no effect in .NET 6.0+.

Indica che gli eventuali membri privati contenuti nei tipi di un assembly non sono disponibili per la reflection.

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
Ereditarietà
DisablePrivateReflectionAttribute
Attributi

Commenti

Nota

I runtime .NET Framework, .NET Core e .NET non applicano in modo coerente questo attributo. Gli sviluppatori non devono basarsi su questo attributo per limitare l'accesso ai membri non pubblici di un assembly.

In genere, i metodi di reflection, ad Type.GetMethod esempio o PropertyInfo.GetValue, possono essere usati per ottenere informazioni sui membri privati in fase di esecuzione. Quando si applica a un assembly, l'attributo DisablePrivateReflectionAttribute rende disponibili informazioni sui membri privati nei tipi di assembly non disponibili per la reflection di runtime.

Costruttori

DisablePrivateReflectionAttribute()

Inizializza una nuova istanza della classe DisablePrivateReflectionAttribute.

Proprietà

TypeId

Quando è implementata in una classe derivata, ottiene un identificatore univoco della classe Attribute.

(Ereditato da Attribute)

Metodi

Equals(Object)

Restituisce un valore che indica se questa istanza è uguale a un oggetto specificato.

(Ereditato da Attribute)
GetHashCode()

Restituisce il codice hash per l'istanza.

(Ereditato da Attribute)
GetType()

Ottiene l'oggetto Type dell'istanza corrente.

(Ereditato da Object)
IsDefaultAttribute()

In caso di override in una classe derivata, indica se il valore di questa istanza è il valore predefinito per la classe derivata.

(Ereditato da Attribute)
Match(Object)

Quando è sottoposto a override in una classe derivata, restituisce un valore che indica se questa istanza equivale a un oggetto specificato.

(Ereditato da Attribute)
MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Implementazioni dell'interfaccia esplicita

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

Esegue il mapping di un set di nomi a un set corrispondente di ID dispatch.

(Ereditato da Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Recupera le informazioni sul tipo relative a un oggetto, che possono essere usate per ottenere informazioni sul tipo relative a un'interfaccia.

(Ereditato da Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Recupera il numero delle interfacce di informazioni sul tipo fornite da un oggetto (0 o 1).

(Ereditato da Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fornisce l'accesso a proprietà e metodi esposti da un oggetto.

(Ereditato da Attribute)

Si applica a