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)

适用于