EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.
Ce sujet n'a pas encore été évalué - Évaluez ce sujet

ILGenerator Class

April 12, 2014

Generates Microsoft intermediate language (MSIL) instructions.

System.Object
  System.Reflection.Emit.ILGenerator

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

The ILGenerator type exposes the following members.

  NameDescription
Public propertyILOffsetGets the current offset, in bytes, in the Microsoft intermediate language (MSIL) stream that is being emitted by the ILGenerator.
Top
  NameDescription
Public methodBeginCatchBlockBegins a catch block.
Public methodBeginExceptFilterBlockBegins an exception block for a filtered exception.
Public methodBeginExceptionBlockBegins an exception block for a non-filtered exception.
Public methodBeginFaultBlockBegins an exception fault block in the Microsoft intermediate language (MSIL) stream.
Public methodBeginFinallyBlockBegins a finally block in the Microsoft intermediate language (MSIL) instruction stream.
Public methodBeginScopeBegins a lexical scope.
Public methodDeclareLocal(Type)Declares a local variable of the specified type.
Public methodDeclareLocal(Type, Boolean)Declares a local variable of the specified type, optionally pinning the object referred to by the variable.
Public methodDefineLabelDeclares a new label.
Public methodEmit(OpCode)Puts the specified instruction onto the stream of instructions.
Public methodEmit(OpCode, Byte)Puts the specified instruction and character argument onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, Double)Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, Int16)Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, Int32)Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, Int64)Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, ConstructorInfo)Puts the specified instruction and metadata token for the specified constructor onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, Label)Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream and leaves space to include a label when fixes are done.
Public methodEmit(OpCode, Label[])Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream and leaves space to include a label when fixes are done.
Public methodEmit(OpCode, LocalBuilder)Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the index of the given local variable.
Public methodEmit(OpCode, SignatureHelper)Puts the specified instruction and a signature token onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, FieldInfo)Puts the specified instruction and metadata token for the specified field onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, MethodInfo)Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given method.
Public methodEmit(OpCode, SByte)Puts the specified instruction and character argument onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, Single)Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.
Public methodEmit(OpCode, String)Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given string.
Public methodEmit(OpCode, Type)Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given type.
Public methodEmitCallPuts a call or callvirt instruction onto the Microsoft intermediate language (MSIL) stream to call a varargs method.
Public methodEmitCalliPuts a Calli instruction onto the Microsoft intermediate language (MSIL) stream, specifying a managed calling convention for the indirect call.
Public methodEmitWriteLine(FieldInfo)Emits the Microsoft intermediate language (MSIL) necessary to call Console.WriteLine with the given field.
Public methodEmitWriteLine(LocalBuilder)Emits the Microsoft intermediate language (MSIL) necessary to call Console.WriteLine with the given local variable.
Public methodEmitWriteLine(String)Emits the Microsoft intermediate language (MSIL) to call Console.WriteLine with a string.
Public methodEndExceptionBlockEnds an exception block.
Public methodEndScopeEnds a lexical scope.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodMarkLabelMarks the Microsoft intermediate language (MSIL) stream's current position with the given label.
Public methodMarkSequencePointMarks a sequence point in the Microsoft intermediate language (MSIL) stream.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodThrowExceptionEmits an instruction to throw an exception.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodUsingNamespaceSpecifies the namespace to be used in evaluating locals and watches for the current active lexical scope.
Top

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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

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

Cela vous a-t-il été utile ?
(1500 caractères restants)
Merci pour vos suggestions.
Afficher:
© 2014 Microsoft. Tous droits réservés.