ILGenerator Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Generates Microsoft intermediate language (MSIL) instructions.
Assembly: mscorlib (in mscorlib.dll)
The ILGenerator type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | BeginCatchBlock | Begins a catch block. |
![]() | BeginExceptFilterBlock | Begins an exception block for a filtered exception. |
![]() | BeginExceptionBlock | Begins an exception block for a non-filtered exception. |
![]() | BeginFaultBlock | Begins an exception fault block in the Microsoft intermediate language (MSIL) stream. |
![]() | BeginFinallyBlock | Begins a finally block in the Microsoft intermediate language (MSIL) instruction stream. |
![]() | BeginScope | Begins a lexical scope. |
![]() | DeclareLocal(Type) | Declares a local variable of the specified type. |
![]() | DeclareLocal(Type, Boolean) | Declares a local variable of the specified type, optionally pinning the object referred to by the variable. |
![]() | DefineLabel | Declares a new label. |
![]() | Emit(OpCode) | Puts the specified instruction onto the stream of instructions. |
![]() | Emit(OpCode, Byte) | Puts the specified instruction and character argument onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, Double) | Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, Int16) | Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, Int32) | Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, Int64) | Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, ConstructorInfo) | Puts the specified instruction and metadata token for the specified constructor onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, Label) | Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream and leaves space to include a label when fixes are done. |
![]() | Emit(OpCode, array<Label>) | Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream and leaves space to include a label when fixes are done. |
![]() | Emit(OpCode, LocalBuilder) | Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the index of the given local variable. |
![]() | Emit(OpCode, SignatureHelper) | Puts the specified instruction and a signature token onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, FieldInfo) | Puts the specified instruction and metadata token for the specified field onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, MethodInfo) | Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given method. |
![]() | Emit(OpCode, SByte) | Puts the specified instruction and character argument onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, Single) | Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions. |
![]() | Emit(OpCode, String) | Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given string. |
![]() | Emit(OpCode, Type) | Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given type. |
![]() | EmitCall | Puts a call or callvirt instruction onto the Microsoft intermediate language (MSIL) stream to call a varargs method. |
![]() | EmitCalli | Puts a Calli instruction onto the Microsoft intermediate language (MSIL) stream, specifying a managed calling convention for the indirect call. |
![]() | EmitWriteLine(FieldInfo) | Emits the Microsoft intermediate language (MSIL) necessary to call Console::WriteLine with the given field. |
![]() | EmitWriteLine(LocalBuilder) | Emits the Microsoft intermediate language (MSIL) necessary to call Console::WriteLine with the given local variable. |
![]() | EmitWriteLine(String) | Emits the Microsoft intermediate language (MSIL) to call Console::WriteLine with a string. |
![]() | EndExceptionBlock | Ends an exception block. |
![]() | EndScope | Ends a lexical scope. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MarkLabel | Marks the Microsoft intermediate language (MSIL) stream's current position with the given label. |
![]() | MarkSequencePoint | Marks a sequence point in the Microsoft intermediate language (MSIL) stream. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ThrowException | Emits an instruction to throw an exception. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | UsingNamespace | Specifies the namespace to be used in evaluating locals and watches for the current active lexical scope. |
ILGenerator is used to generate method bodies for standalone dynamic methods (represented by the DynamicMethod class). To obtain an ILGenerator, use the DynamicMethod::GetILGenerator method.
MSIL is used as input to a just-in-time (JIT) compiler.
Show:


