RequiresDynamicCodeAttribute 類別

定義

表示指定的方法需要能夠在執行時間產生新的程式碼,例如透過 System.Reflection

public ref class RequiresDynamicCodeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed class RequiresDynamicCodeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)>]
type RequiresDynamicCodeAttribute = class
    inherit Attribute
Public NotInheritable Class RequiresDynamicCodeAttribute
Inherits Attribute
繼承
RequiresDynamicCodeAttribute
屬性

備註

此特性讓工具能事先了解哪些方法不安全,不能提前編譯。 更多資訊請參閱《 進攻的巨人警告導論》。

建構函式

名稱 Description
RequiresDynamicCodeAttribute(String)

初始化一個新的類別實例 RequiresDynamicCodeAttribute ,並以指定訊息進行。

屬性

名稱 Description
ExcludeStatics

取得或設定一個值,指示註解是否應適用於靜態成員。

Message

會收到包含動態程式碼使用資訊的訊息。

TypeId

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

(繼承來源 Attribute)
Url

取得或設定一個可選的 URL,包含更多關於方法的資訊、為何需要動態程式碼,以及消費者可選擇的處理方式。

方法

名稱 Description
Equals(Object)

傳回值,這個值表示這個實例是否等於指定的物件。

(繼承來源 Attribute)
GetHashCode()

傳回這個實例的哈希碼。

(繼承來源 Attribute)
GetType()

取得目前實例的 Type

(繼承來源 Object)
IsDefaultAttribute()

在衍生類別中覆寫時,指出這個實例的值是否為衍生類別的預設值。

(繼承來源 Attribute)
Match(Object)

在衍生類別中覆寫時,傳回值,指出這個實例是否等於指定的物件。

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

適用於

另請參閱