ConstructorBuilder.SetMethodBody Método

Definición

Crea el cuerpo del constructor mediante una matriz de bytes especificada de Microsoft instrucciones de lenguaje intermedio (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))

Parámetros

il
Byte[]

Matriz que contiene instrucciones MSIL válidas.

maxStack
Int32

Profundidad máxima de evaluación de la pila.

localSignature
Byte[]

Matriz de bytes que contienen la estructura de variables local serializadas. Especifique null si el constructor no tiene variables locales.

exceptionHandlers
IEnumerable<ExceptionHandler>

Colección que contiene los controladores de excepciones para el constructor. Especifique null si el constructor no tiene controladores de excepciones.

tokenFixups
IEnumerable<Int32>

Colección de valores que representan desplazamientos en il, cada uno de los cuales especifica el principio de un token que se puede modificar. Especifique null si el constructor no tiene tokens que se deben modificar.

Excepciones

il es null.

maxStack es negativo.

O bien

Uno de exceptionHandlers especifica un desplazamiento fuera de il.

O bien

Uno de especifica un desplazamiento que está fuera de tokenFixups la il matriz.

El tipo contenedor se creó anteriormente mediante el CreateType() método .

O bien

Este método se llamó anteriormente en este ConstructorBuilder objeto.

Se aplica a