System.Reflection.Emit 命名空间

System.Reflection.Emit 命名空间包含允许编译器或工具发出元数据和 Microsoft 中间语言 (MSIL) 并可选择在磁盘上生成 PE 文件的类。 The System.Reflection.Emit namespace contains classes that allow a compiler or tool to emit metadata and Microsoft intermediate language (MSIL) and optionally generate a PE file on disk. 这些类的主要客户端是脚本引擎和编译器。 The primary clients of these classes are script engines and compilers.

AssemblyBuilder

定义并表示动态程序集。Defines and represents a dynamic assembly.

ConstructorBuilder

定义并表示动态类的构造函数。Defines and represents a constructor of a dynamic class.

CustomAttributeBuilder

帮助生成自定义特性。Helps build custom attributes.

DynamicILInfo

提供对多种用来为动态方法生成 Microsoft 中间语言 (MSIL) 和元数据的其他方式的支持,包括用来创建标记和插入代码的方法、异常处理,以及局部变量签名 Blob。Provides support for alternative ways to generate the Microsoft intermediate language (MSIL) and metadata for a dynamic method, including methods for creating tokens and for inserting the code, exception handling, and local variable signature blobs.

DynamicMethod

定义并表示一种可编译、执行和丢弃的动态方法。Defines and represents a dynamic method that can be compiled, executed, and discarded. 丢弃的方法可用于垃圾回收。Discarded methods are available for garbage collection.

EnumBuilder

说明并表示枚举类型。Describes and represents an enumeration type.

EventBuilder

定义类的事件。Defines events for a class.

FieldBuilder

定义并表示字段。Defines and represents a field. 此类不能被继承。This class cannot be inherited.

GenericTypeParameterBuilder

为动态定义的泛型类型与方法定义和创建泛型类型参数。Defines and creates generic type parameters for dynamically defined generic types and methods. 此类不能被继承。This class cannot be inherited.

ILGenerator

生成 Microsoft 中间语言 (MSIL) 指令。Generates Microsoft intermediate language (MSIL) instructions.

LocalBuilder

表示方法或构造函数内的局部变量。Represents a local variable within a method or constructor.

MethodBuilder

定义并表示动态类上的方法(或构造函数)。Defines and represents a method (or constructor) on a dynamic class.

MethodRental

在给定类的方法的情况下,提供一种交换方法体实现的快速方法。Provides a fast way to swap method body implementation given a method of a class.

ModuleBuilder

定义和表示动态程序集中的模块。Defines and represents a module in a dynamic assembly.

OpCodes

通过 ILGenerator 类成员(例如 Emit(OpCode))为发出提供 Microsoft 中间语言 (MSIL) 指令的字段表示形式。Provides field representations of the Microsoft Intermediate Language (MSIL) instructions for emission by the ILGenerator class members (such as Emit(OpCode)).

ParameterBuilder

创建或关联参数信息。Creates or associates parameter information.

PropertyBuilder

定义类型的属性。Defines the properties for a type.

SignatureHelper

提供生成签名的方法。Provides methods for building signatures.

TypeBuilder

在运行时定义并创建类的新实例。Defines and creates new instances of classes during run time.

UnmanagedMarshal

表示说明如何将字段从托管代码封送为非托管代码的类。Represents the class that describes how to marshal a field from managed to unmanaged code. 此类不能被继承。This class cannot be inherited.

结构

EventToken

表示由元数据返回以表示某事件的 TokenRepresents the Token returned by the metadata to represent an event.

ExceptionHandler

表示传递给方法(如 SetMethodBody(Byte[], Int32, Byte[], IEnumerable<ExceptionHandler>, IEnumerable<Int32>))的 IL 字节数组中的异常处理程序。Represents an exception handler in a byte array of IL to be passed to a method such as SetMethodBody(Byte[], Int32, Byte[], IEnumerable<ExceptionHandler>, IEnumerable<Int32>).

FieldToken

FieldToken 结构是表示字段的令牌的对象表示形式。The FieldToken struct is an object representation of a token that represents a field.

Label

表示指令流中的标签。Represents a label in the instruction stream. LabelILGenerator 类一起使用。Label is used in conjunction with the ILGenerator class.

MethodToken

MethodToken 结构是表示方法的标记的对象表示形式。The MethodToken struct is an object representation of a token that represents a method.

OpCode

介绍中间语言 (IL) 指令。Describes an intermediate language (IL) instruction.

ParameterToken

ParameterToken 结构是由元数据返回以表示参数的标记的不透明表示形式。The ParameterToken struct is an opaque representation of the token returned by the metadata to represent a parameter.

PropertyToken

PropertyToken 结构是由元数据返回以表示属性的 Token 的不透明表示形式。The PropertyToken struct is an opaque representation of the Token returned by the metadata to represent a property.

SignatureToken

表示由元数据返回以表示签名的 TokenRepresents the Token returned by the metadata to represent a signature.

StringToken

表示用于表示字符串的标记。Represents a token that represents a string.

TypeToken

表示由元数据返回以表示类型的 TokenRepresents the Token returned by the metadata to represent a type.

枚举

AssemblyBuilderAccess

定义动态程序集的访问模式。Defines the access modes for a dynamic assembly.

FlowControl

描述指令如何改变控制流。Describes how an instruction alters the flow of control.

OpCodeType

描述 Microsoft 中间语言 (MSIL) 指令的类型。Describes the types of the Microsoft intermediate language (MSIL) instructions.

OperandType

描述 Microsoft 中间语言 (MSIL) 指令的操作数类型。Describes the operand type of Microsoft intermediate language (MSIL) instruction.

PackingSize

指定在封送类型时用于确定字段的内存对齐方式的两个因数中的一个。Specifies one of two factors that determine the memory alignment of fields when a type is marshaled.

PEFileKinds

指定可移植可执行 (PE) 文件的类型。Specifies the type of the portable executable (PE) file.

StackBehaviour

描述如何将值推到堆栈上或从堆栈中弹出。Describes how values are pushed onto a stack or popped off a stack.