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 nieodwołanego 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 niereferenowanego kodu.

TypeId

Po zaimplementowaniu w klasie pochodnej pobiera unikatowy identyfikator dla tego elementu Attribute.

(Odziedziczone po Attribute)
Url

Pobiera lub ustawia opcjonalny adres URL, który zawiera więcej informacji o metodzie, dlaczego wymaga niereferencji kodu i jakie opcje ma do czynienia z nim 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 bieżące wystąpienie.

(Odziedziczone po Object)
IsDefaultAttribute()

W przypadku zastąpienia w klasie pochodnej wskazuje, czy wartość tego wystąpienia jest wartością domyślną klasy pochodnej.

(Odziedziczone po Attribute)
Match(Object)

W przypadku zastąpienia 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ż