System.Reflection.Emit.ILGenerator.Emit Method

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

Syntax

public virtual void Emit (OpCode opcode, System.Reflection.MethodInfo meth)

Parameters

opcode
The MSIL instruction to be emitted onto the stream.
meth
A MethodInfo representing a method.

Remarks

The instruction values are defined in the OpCodes enumeration.

The location of meth is recorded so that the instruction stream can be patched if necessary when persisting the module to a portable executable (PE) file.

If meth represents a generic method, it must be a generic method definition. That is, its System.Reflection.MethodInfo.IsGenericMethodDefinition property must be true.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0