MethodBuilder.InitLocals 属性
定义
获取或设置一个布尔值,该值指定此方法中的局部变量是否初始化为零。Gets or sets a Boolean value that specifies whether the local variables in this method are zero initialized. 此属性的默认值为 true。The default value of this property is true.
public:
property bool InitLocals { bool get(); void set(bool value); };
public bool InitLocals { get; set; }
member this.InitLocals : bool with get, set
Public Property InitLocals As Boolean
属性值
如果应将此方法中的局部变量初始化为零,则为 true;否则为 false。true if the local variables in this method should be zero initialized; otherwise false.
例外
对于当前的方法,属性 IsGenericMethod 为 true,但属性 IsGenericMethodDefinition 为 false。For the current method, the IsGenericMethod property is true, but the IsGenericMethodDefinition property is false. (获取或设置。)(Get or set.)
注解
如果将此属性设置为 true ,则发出的 MSIL 包括初始化局部变量。If this property is set to true, the emitted MSIL includes initialization of local variables. 如果将其设置为 false ,则不初始化局部变量,并且无法验证所生成的代码。If it is set to false, local variables are not initialized and the generated code is unverifiable.