RequiresUnreferencedCodeAttribute 類別

定義

表示所指定方法需要動態存取不是以靜態方式參考的程式碼,例如透過 System.Reflection

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
繼承
RequiresUnreferencedCodeAttribute
屬性

備註

此屬性可讓工具瞭解從應用程式移除未參考的程式碼時,哪些方法不安全。 如需詳細資訊,請參閱 修剪警告簡介

建構函式

RequiresUnreferencedCodeAttribute(String)

使用指定的訊息初始化 RequiresUnreferencedCodeAttribute 類別的新執行個體。

屬性

Message

取得包含未參考程式碼使用方式資訊的訊息。

TypeId

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。

(繼承來源 Attribute)
Url

取得或設定選擇性 URL,其中包含方法的詳細資訊、為何需要未參考的程式碼,以及取用者必須處理的選項。

方法

Equals(Object)

傳回值,這個值指出此執行個體是否與指定的物件相等。

(繼承來源 Attribute)
GetHashCode()

傳回這個執行個體的雜湊碼。

(繼承來源 Attribute)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IsDefaultAttribute()

在衍生類別中覆寫時,表示這個執行個體的值是衍生類別的預設值。

(繼承來源 Attribute)
Match(Object)

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱