MethodBuilder.SetMethodBody 메서드

정의

MSIL(Microsoft 중간 언어) 명령의 지정된 바이트 배열을 사용하여 메서드의 본문을 만듭니다.

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[]

serialize된 로컬 변수 구조를 포함하는 바이트 배열입니다. 메서드에 로컬 변수가 없는 경우 null 을 지정합니다.

exceptionHandlers
IEnumerable<ExceptionHandler>

메서드에 대한 예외 처리기를 포함하는 컬렉션입니다. 메서드에 예외 처리기가 없는 경우 null 을 지정합니다.

tokenFixups
IEnumerable<Int32>

수정할 수 있는 토큰의 시작을 각각 지정하는 il의 오프셋을 나타내는 값의 컬렉션입니다. 메서드에 수정해야 하는 토큰이 없을 경우 null 을 지정합니다.

예외

il이(가) null인 경우

maxStack가 음수입니다.

또는 exceptionHandlers 중 하나가 il 오프셋 외부를 지정합니다.

또는 tokenFixups 중 하나가 il 배열 외부의 오프셋을 지정합니다.

포함하는 형식은 CreateType() 메서드를 사용하여 이전에 만든 것입니다.

또는 이 메서드는 이 MethodBuilder 개체에서 이전에 호출되었습니다.

적용 대상