ILGenerator Class

 

Generates Microsoft intermediate language (MSIL) instructions.

Namespace:   System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

System.Object
  System.Reflection.Emit.ILGenerator

[ClassInterfaceAttribute(ClassInterfaceType.None)]
[ComVisibleAttribute(true)]
public class ILGenerator : _ILGenerator

NameDescription
System_CAPS_pubpropertyILOffset

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

NameDescription
System_CAPS_pubmethodBeginCatchBlock(Type)

Begins a catch block.

System_CAPS_pubmethodBeginExceptFilterBlock()

Begins an exception block for a filtered exception.

System_CAPS_pubmethodBeginExceptionBlock()

Begins an exception block for a non-filtered exception.

System_CAPS_pubmethodBeginFaultBlock()

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

System_CAPS_pubmethodBeginFinallyBlock()

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

System_CAPS_pubmethodBeginScope()

Begins a lexical scope.

System_CAPS_pubmethodDeclareLocal(Type)

Declares a local variable of the specified type.

System_CAPS_pubmethodDeclareLocal(Type, Boolean)

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

System_CAPS_pubmethodDefineLabel()

Declares a new label.

System_CAPS_pubmethodEmit(OpCode)

Puts the specified instruction onto the stream of instructions.

System_CAPS_pubmethodEmit(OpCode, Byte)

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

System_CAPS_pubmethodEmit(OpCode, ConstructorInfo)

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

System_CAPS_pubmethodEmit(OpCode, Double)

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

System_CAPS_pubmethodEmit(OpCode, FieldInfo)

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

System_CAPS_pubmethodEmit(OpCode, Int16)

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

System_CAPS_pubmethodEmit(OpCode, Int32)

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

System_CAPS_pubmethodEmit(OpCode, Int64)

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

System_CAPS_pubmethodEmit(OpCode, Label)

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

System_CAPS_pubmethodEmit(OpCode, Label[])

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

System_CAPS_pubmethodEmit(OpCode, LocalBuilder)

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

System_CAPS_pubmethodEmit(OpCode, MethodInfo)

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

System_CAPS_pubmethodEmit(OpCode, SByte)

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

System_CAPS_pubmethodEmit(OpCode, SignatureHelper)

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

System_CAPS_pubmethodEmit(OpCode, Single)

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

System_CAPS_pubmethodEmit(OpCode, String)

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

System_CAPS_pubmethodEmit(OpCode, Type)

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

System_CAPS_pubmethodEmitCall(OpCode, MethodInfo, Type[])

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

System_CAPS_pubmethodEmitCalli(OpCode, CallingConvention, Type, Type[])

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

System_CAPS_pubmethodEmitCalli(OpCode, CallingConventions, Type, Type[], Type[])

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

System_CAPS_pubmethodEmitWriteLine(FieldInfo)

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

System_CAPS_pubmethodEmitWriteLine(LocalBuilder)

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

System_CAPS_pubmethodEmitWriteLine(String)

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

System_CAPS_pubmethodEndExceptionBlock()

Ends an exception block.

System_CAPS_pubmethodEndScope()

Ends a lexical scope.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodMarkLabel(Label)

Marks the Microsoft intermediate language (MSIL) stream's current position with the given label.

System_CAPS_pubmethodMarkSequencePoint(ISymbolDocumentWriter, Int32, Int32, Int32, Int32)

Marks a sequence point in the Microsoft intermediate language (MSIL) stream.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodThrowException(Type)

Emits an instruction to throw an exception.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodUsingNamespace(String)

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

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethod_ILGenerator.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Maps a set of names to a corresponding set of dispatch identifiers.

System_CAPS_pubinterfaceSystem_CAPS_privmethod_ILGenerator.GetTypeInfo(UInt32, UInt32, IntPtr)

Retrieves the type information for an object, which can then be used to get the type information for an interface.

System_CAPS_pubinterfaceSystem_CAPS_privmethod_ILGenerator.GetTypeInfoCount(UInt32)

Retrieves the number of type information interfaces that an object provides (either 0 or 1).

System_CAPS_pubinterfaceSystem_CAPS_privmethod_ILGenerator.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Provides access to properties and methods exposed by an object.

ILGenerator is used to generate method bodies for methods and constructors in dynamic assemblies (represented by the MethodBuilder and ConstructorBuilder classes) and for standalone dynamic methods (represented by the DynamicMethod class). To obtain an ILGenerator, use the ConstructorBuilder.GetILGenerator, DynamicMethod.GetILGenerator, and MethodBuilder.GetILGenerator methods.

MSIL is used as input to a just-in-time (JIT) compiler.

.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: