System.CodeDom 命名空间

System.CodeDom 命名空间包含可以用于表示源代码文档的元素和结构的类。 The System.CodeDom namespace contains classes that can be used to represent the elements and structure of a source code document. 此命名空间中的类可用来建立源代码文档结构的模型,使用 System.CodeDom.Compiler 命名空间提供的功能可以将源代码文档输出为所支持语言的源代码。 The classes in this namespace can be used to model the structure of a source code document that can be output as source code in a supported language using the functionality provided by the System.CodeDom.Compiler namespace.

CodeArgumentReferenceExpression

表示对传递到方法的参数值的引用。Represents a reference to the value of an argument passed to a method.

CodeArrayCreateExpression

表示创建数组的表达式。Represents an expression that creates an array.

CodeArrayIndexerExpression

表示对数组的索引的引用。Represents a reference to an index of an array.

CodeAssignStatement

表示简单的赋值语句。Represents a simple assignment statement.

CodeAttachEventStatement

表示向事件附加事件处理程序委托的语句。Represents a statement that attaches an event-handler delegate to an event.

CodeAttributeArgument

表示在元数据特性声明中使用的参数。Represents an argument used in a metadata attribute declaration.

CodeAttributeArgumentCollection

表示 CodeAttributeArgument 对象集合。Represents a collection of CodeAttributeArgument objects.

CodeAttributeDeclaration

表示特性声明。Represents an attribute declaration.

CodeAttributeDeclarationCollection

表示 CodeAttributeDeclaration 对象集合。Represents a collection of CodeAttributeDeclaration objects.

CodeBaseReferenceExpression

表示对基类的引用。Represents a reference to the base class.

CodeBinaryOperatorExpression

表示一个表达式,该表达式包含在两个表达式间进行的二进制运算。Represents an expression that consists of a binary operation between two expressions.

CodeCastExpression

表示到一种数据类型或接口的表达式转换。Represents an expression cast to a data type or interface.

CodeCatchClause

表示 catch 语句的 try/catch 异常块。Represents a catch exception block of a try/catch statement.

CodeCatchClauseCollection

表示 CodeCatchClause 对象集合。Represents a collection of CodeCatchClause objects.

CodeChecksumPragma

表示代码校验和杂注代码实体。Represents a code checksum pragma code entity.

CodeComment

表示注释。Represents a comment.

CodeCommentStatement

表示由单个注释构成的语句。Represents a statement consisting of a single comment.

CodeCommentStatementCollection

表示 CodeCommentStatement 对象集合。Represents a collection of CodeCommentStatement objects.

CodeCompileUnit

为 CodeDOM 程序图形提供容器。Provides a container for a CodeDOM program graph.

CodeConditionStatement

表示条件分支语句,通常表示为一个 if 语句。Represents a conditional branch statement, typically represented as an if statement.

CodeConstructor

表示一个类型的实例构造函数的声明。Represents a declaration for an instance constructor of a type.

CodeDefaultValueExpression

表示对默认值的引用。Represents a reference to a default value.

CodeDelegateCreateExpression

表示创建委托的表达式。Represents an expression that creates a delegate.

CodeDelegateInvokeExpression

表示引发事件的表达式。Represents an expression that raises an event.

CodeDirectionExpression

表示用作方法调用参数及引用方向指示器的表达式。Represents an expression used as a method invoke parameter along with a reference direction indicator.

CodeDirective

用作代码指令类的基类。Serves as the base class for code directive classes.

CodeDirectiveCollection

表示 CodeDirective 对象集合。Represents a collection of CodeDirective objects.

CodeEntryPointMethod

表示可执行文件的入口点方法。Represents the entry point method of an executable.

CodeEventReferenceExpression

表示对事件的引用。Represents a reference to an event.

CodeExpression

表示代码表达式。Represents a code expression. 这是其他从不实例化的代码表达式对象的基类。This is a base class for other code expression objects that is never instantiated.

CodeExpressionCollection

表示 CodeExpression 对象集合。Represents a collection of CodeExpression objects.

CodeExpressionStatement

表示由单个表达式组成的语句。Represents a statement that consists of a single expression.

CodeFieldReferenceExpression

表示对某字段的引用。Represents a reference to a field.

CodeGotoStatement

表示 goto 语句。Represents a goto statement.

CodeIndexerExpression

表示对对象的索引器属性的引用。Represents a reference to an indexer property of an object.

CodeIterationStatement

表示 for 语句或语句块内的循环(使用测试表达式作为继续循环的条件)。Represents a for statement, or a loop through a block of statements, using a test expression as a condition for continuing to loop.

CodeLabeledStatement

表示标记语句或独立标签。Represents a labeled statement or a stand-alone label.

CodeLinePragma

表示特定文件内的特定位置。Represents a specific location within a specific file.

CodeMemberEvent

表示一个类型的事件的声明。Represents a declaration for an event of a type.

CodeMemberField

表示某种类型的字段的声明。Represents a declaration for a field of a type.

CodeMemberMethod

表示某种类型的方法的声明。Represents a declaration for a method of a type.

CodeMemberProperty

表示某种类型的属性的声明。Represents a declaration for a property of a type.

CodeMethodInvokeExpression

表示调用方法的表达式。Represents an expression that invokes a method.

CodeMethodReferenceExpression

表示方法的引用。Represents a reference to a method.

CodeMethodReturnStatement

表示返回值语句。Represents a return value statement.

CodeNamespace

表示命名空间声明。Represents a namespace declaration.

CodeNamespaceCollection

表示 CodeNamespace 对象集合。Represents a collection of CodeNamespace objects.

CodeNamespaceImport

表示某命名空间导入指令,该指令指示要使用的命名空间。Represents a namespace import directive that indicates a namespace to use.

CodeNamespaceImportCollection

表示 CodeNamespaceImport 对象集合。Represents a collection of CodeNamespaceImport objects.

CodeObject

为大部分代码文档对象模型 (CodeDOM) 对象提供通用基类。Provides a common base class for most Code Document Object Model (CodeDOM) objects.

CodeObjectCreateExpression

表示创建某种类型的新实例的表达式。Represents an expression that creates a new instance of a type.

CodeParameterDeclarationExpression

表示方法、属性或构造函数的参数声明。Represents a parameter declaration for a method, property, or constructor.

CodeParameterDeclarationExpressionCollection

表示 CodeParameterDeclarationExpression 对象集合。Represents a collection of CodeParameterDeclarationExpression objects.

CodePrimitiveExpression

表示基元数据类型的值。Represents a primitive data type value.

CodePropertyReferenceExpression

表示属性值的引用。Represents a reference to the value of a property.

CodePropertySetValueReferenceExpression

表示属性集方法内的属性集方法调用的值参数。Represents the value argument of a property set method call within a property set method.

CodeRegionDirective

指定代码区域的名称和模式。Specifies the name and mode for a code region.

CodeRemoveEventStatement

表示移除事件处理程序的语句。Represents a statement that removes an event handler.

CodeSnippetCompileUnit

表示可编译的原义代码片段。Represents a literal code fragment that can be compiled.

CodeSnippetExpression

表示文本表达式。Represents a literal expression.

CodeSnippetStatement

使用原义代码片段表示一条语句。Represents a statement using a literal code fragment.

CodeSnippetTypeMember

使用原义代码片段表示类型成员。Represents a member of a type using a literal code fragment.

CodeStatement

表示从中派生所有代码语句的 abstract 基类。Represents the abstract base class from which all code statements derive.

CodeStatementCollection

表示 CodeStatement 对象集合。Represents a collection of CodeStatement objects.

CodeThisReferenceExpression

表示对当前本地类实例的引用。Represents a reference to the current local class instance.

CodeThrowExceptionStatement

表示引发异常的语句。Represents a statement that throws an exception.

CodeTryCatchFinallyStatement

表示一个 try 块,具有任意数量的 catch 子句和一个可选的 finally 块。Represents a try block with any number of catch clauses and, optionally, a finally block.

CodeTypeConstructor

表示类的静态构造函数。Represents a static constructor for a class.

CodeTypeDeclaration

表示类、结构、接口或枚举的类型声明。Represents a type declaration for a class, structure, interface, or enumeration.

CodeTypeDeclarationCollection

表示 CodeTypeDeclaration 对象集合。Represents a collection of CodeTypeDeclaration objects.

CodeTypeDelegate

表示委托声明。Represents a delegate declaration.

CodeTypeMember

为类型的成员提供基类。Provides a base class for a member of a type. 类型成员包括字段、方法、属性、构造函数和嵌套类型。Type members include fields, methods, properties, constructors and nested types.

CodeTypeMemberCollection

表示 CodeTypeMember 对象集合。Represents a collection of CodeTypeMember objects.

CodeTypeOfExpression

表示 typeof 表达式,该表达式返回指定类型名称的 TypeRepresents a typeof expression, an expression that returns a Type for a specified type name.

CodeTypeParameter

表示泛型类型或方法的类型参数。Represents a type parameter of a generic type or method.

CodeTypeParameterCollection

表示 CodeTypeParameter 对象集合。Represents a collection of CodeTypeParameter objects.

CodeTypeReference

表示对某类型的引用。Represents a reference to a type.

CodeTypeReferenceCollection

表示 CodeTypeReference 对象集合。Represents a collection of CodeTypeReference objects.

CodeTypeReferenceExpression

表示对某数据类型的引用。Represents a reference to a data type.

CodeVariableDeclarationStatement

表示变量声明。Represents a variable declaration.

CodeVariableReferenceExpression

表示局部变量的引用。Represents a reference to a local variable.

枚举

CodeBinaryOperatorType

为受支持的二进制运算符定义标识符。Defines identifiers for supported binary operators.

CodeRegionMode

指定代码区域的开始或结束。Specifies the start or end of a code region.

CodeTypeReferenceOptions

指定代码类型引用的解析方式。Specifies how the code type reference is to be resolved.

FieldDirection

定义用于指示参数的方向和参数声明的标识符。Defines identifiers used to indicate the direction of parameter and argument declarations.

MemberAttributes

定义类成员的成员特性标识符。Defines member attribute identifiers for class members.

注解

有关使用 CodeDOM 表示和生成源代码的详细信息,请参阅动态源代码生成和编译For more information about using the CodeDOM to represent and generate source code, see Dynamic Source Code Generation and Compilation.

列出了按类型和函数的 CodeDOM 元素的表,请参阅CodeDOM 快速参考For a table that lists the CodeDOM elements by type and function, see the CodeDOM Quick Reference.