ConstructorBuilder.SetMethodBody 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用Microsoft中间语言(MSIL)指令的指定字节数组创建构造函数的正文。
public:
void SetMethodBody(cli::array <System::Byte> ^ il, int maxStack, cli::array <System::Byte> ^ localSignature, System::Collections::Generic::IEnumerable<System::Reflection::Emit::ExceptionHandler> ^ exceptionHandlers, System::Collections::Generic::IEnumerable<int> ^ tokenFixups);
public void SetMethodBody(byte[] il, int maxStack, byte[] localSignature, System.Collections.Generic.IEnumerable<System.Reflection.Emit.ExceptionHandler> exceptionHandlers, System.Collections.Generic.IEnumerable<int> tokenFixups);
member this.SetMethodBody : byte[] * int * byte[] * seq<System.Reflection.Emit.ExceptionHandler> * seq<int> -> unit
Public Sub SetMethodBody (il As Byte(), maxStack As Integer, localSignature As Byte(), exceptionHandlers As IEnumerable(Of ExceptionHandler), tokenFixups As IEnumerable(Of Integer))
参数
- il
- Byte[]
包含有效 MSIL 指令的数组。
- maxStack
- Int32
最大堆栈评估深度。
- localSignature
- Byte[]
包含序列化本地变量结构的字节数组。 指定 null 构造函数是否没有局部变量。
- exceptionHandlers
- IEnumerable<ExceptionHandler>
包含构造函数的异常处理程序的集合。 指定 null 构造函数是否没有异常处理程序。
- tokenFixups
- IEnumerable<Int32>
一个值集合,这些值表示偏移 il量,其中每个值指定可修改的标记的开头。 指定 null 构造函数是否没有必须修改的标记。
例外
il 是 null。
maxStack 为负数。
-或-
其中一个 exceptionHandlers 指定了外部的 il偏移量。
-或-
其中 tokenFixups 一个指定数组外部的 il 偏移量。