RequiresUnreferencedCodeAttribute Klasa

Definicja

Wskazuje, że określona metoda wymaga dynamicznego dostępu do kodu, do którego nie odwołuje się statycznie, na przykład za pośrednictwem System.Reflectionmetody .

public ref class RequiresUnreferencedCodeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed class RequiresUnreferencedCodeAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed class RequiresUnreferencedCodeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)>]
type RequiresUnreferencedCodeAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)>]
type RequiresUnreferencedCodeAttribute = class
    inherit Attribute
Public NotInheritable Class RequiresUnreferencedCodeAttribute
Inherits Attribute
Dziedziczenie
RequiresUnreferencedCodeAttribute
Atrybuty

Uwagi

Ten atrybut umożliwia narzędziom zrozumienie, które metody są niebezpieczne do wywołania podczas usuwania nieużywanego kodu z aplikacji. Aby uzyskać więcej informacji, zobacz Wprowadzenie do ostrzeżeń dotyczących przycinania.

Konstruktory

RequiresUnreferencedCodeAttribute(String)

Inicjuje nowe wystąpienie klasy RequiresUnreferencedCodeAttribute z określonym komunikatem.

Właściwości

Message

Pobiera komunikat zawierający informacje o użyciu nieużywanego kodu.

TypeId

Po zaimplementowaniu w klasie pochodnej pobiera unikatowy identyfikator dla tego Attributeelementu .

(Odziedziczone po Attribute)
Url

Pobiera lub ustawia opcjonalny adres URL, który zawiera więcej informacji o metodzie, dlaczego wymaga niereferencyjnego kodu i jakie opcje ma do czynienia użytkownik.

Metody

Equals(Object)

Zwraca wartość wskazującą, czy to wystąpienie jest równe podanemu obiektowi.

(Odziedziczone po Attribute)
GetHashCode()

Zwraca wartość skrótu dla tego wystąpienia.

(Odziedziczone po Attribute)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
IsDefaultAttribute()

Podczas zastępowania w klasie pochodnej wskazuje, czy wartość tego wystąpienia jest wartością domyślną dla klasy pochodnej.

(Odziedziczone po Attribute)
Match(Object)

Po przesłonięciu w klasie pochodnej zwraca wartość wskazującą, czy to wystąpienie jest równe określonemu obiektowi.

(Odziedziczone po Attribute)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy

Zobacz też