SkipLocalsInitAttribute 類別

定義

指示編譯器,在發出至中繼資料時,不應該在巢狀方法標頭中設定 .locals init 旗標。

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

備註

這個屬性不安全,因為它可能會在特定實例中向應用程式顯示未初始化的記憶體 (,例如從未初始化的堆疊配置記憶體讀取) 。 如果直接套用至方法,屬性會套用至該方法及其所有巢狀函式,包括 Lambda 和本機函式。 如果套用至類型或模組,則會套用至巢狀內的所有方法。 元件上刻意不允許這個屬性。 若要將 屬性套用至多個類型宣告,請改為在模組層級使用它。

建構函式

SkipLocalsInitAttribute()

初始化 SkipLocalsInitAttribute 類別的新執行個體。

屬性

TypeId

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

(繼承來源 Attribute)

方法

Equals(Object)

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

(繼承來源 Attribute)
GetHashCode()

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

(繼承來源 Attribute)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IsDefaultAttribute()

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

(繼承來源 Attribute)
Match(Object)

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

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

適用於