System.Reflection.Emit.ILGeneration by Microsoft

<PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.6.0-preview4.19212.13" />

 ILGenerator

public class ILGenerator
Generates Microsoft intermediate language (MSIL) instructions.
public virtual int ILOffset { get; }

Gets the current offset, in bytes, in the Microsoft intermediate language (MSIL) stream that is being emitted by the ILGenerator.

public virtual void BeginCatchBlock(Type exceptionType)

Begins a catch block.

public virtual void BeginExceptFilterBlock()

Begins an exception block for a filtered exception.

public virtual Label BeginExceptionBlock()

Begins an exception block for a non-filtered exception.

public virtual void BeginFaultBlock()

Begins an exception fault block in the Microsoft intermediate language (MSIL) stream.

public virtual void BeginFinallyBlock()

Begins a finally block in the Microsoft intermediate language (MSIL) instruction stream.

public virtual void BeginScope()

Begins a lexical scope.

public virtual LocalBuilder DeclareLocal(Type localType)

Declares a local variable of the specified type.

public virtual LocalBuilder DeclareLocal(Type localType, bool pinned)

Declares a local variable of the specified type, optionally pinning the object referred to by the variable.

public virtual Label DefineLabel()

Declares a new label.

public virtual void Emit(OpCode opcode)

Puts the specified instruction onto the stream of instructions.

public virtual void Emit(OpCode opcode, byte arg)

Puts the specified instruction and character argument onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, double arg)

Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, short arg)

Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, int arg)

Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, long arg)

Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, ConstructorInfo con)

Puts the specified instruction and metadata token for the specified constructor onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, Label label)

Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream and leaves space to include a label when fixes are done.

public virtual void Emit(OpCode opcode, Label[] labels)

Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream and leaves space to include a label when fixes are done.

public virtual void Emit(OpCode opcode, LocalBuilder local)

Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the index of the given local variable.

public virtual void Emit(OpCode opcode, SignatureHelper signature)

Puts the specified instruction and a signature token onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, FieldInfo field)

Puts the specified instruction and metadata token for the specified field onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, MethodInfo meth)

Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given method.

public void Emit(OpCode opcode, sbyte arg)

Puts the specified instruction and character argument onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, float arg)

Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.

public virtual void Emit(OpCode opcode, string str)

Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given string.

public virtual void Emit(OpCode opcode, Type cls)

Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given type.

public virtual void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[] optionalParameterTypes)

Puts a call or callvirt instruction onto the Microsoft intermediate language (MSIL) stream to call a varargs method.

public virtual void EmitCalli(OpCode opcode, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type[] optionalParameterTypes)

Puts a Calli instruction onto the Microsoft intermediate language (MSIL) stream, specifying a managed calling convention for the indirect call.

public virtual void EmitWriteLine(LocalBuilder localBuilder)

Emits the Microsoft intermediate language (MSIL) necessary to call WriteLine with the given local variable.

public virtual void EmitWriteLine(FieldInfo fld)

Emits the Microsoft intermediate language (MSIL) necessary to call WriteLine with the given field.

public virtual void EmitWriteLine(string value)

Emits the Microsoft intermediate language (MSIL) to call WriteLine with a string.

public virtual void EndExceptionBlock()

Ends an exception block.

public virtual void EndScope()

Ends a lexical scope.

public virtual void MarkLabel(Label loc)

Marks the Microsoft intermediate language (MSIL) stream&#39;s current position with the given label.

public virtual void ThrowException(Type excType)

Emits an instruction to throw an exception.

public virtual void UsingNamespace(string usingNamespace)

Specifies the namespace to be used in evaluating locals and watches for the current active lexical scope.