CodeDOM Quick Reference

The quick reference table below enables developers using the Code Document Object Model (CodeDOM) to search for CodeDOM elements by type and function. This table is sorted by type of CodeDOM or source code element and provides a description as well as a link to reference material for each element. You can find additional information about how the CodeDOM represents source code and generates it in an extensible set of programming languages at Dynamic Source Code Generation and Compilation.

Code Graph Containers

Type of source code element

Representative CodeDOM element

A compilable source code graph.

CodeCompileUnit

A compilable section of literal code.

CodeSnippetCompileUnit

Namespace Declaration Elements

Type of source code element

Representative CodeDOM element

A namespace declaration.

CodeNamespace

A namespace declaration collection.

CodeNamespaceCollection

A namespace import.

CodeNamespaceImport

A namespace import collection.

CodeNamespaceImportCollection

Type Declaration Elements

Type of source code element

Representative CodeDOM element

A type declaration for a class, struct or enumeration.

CodeTypeDeclaration

A type declaration collection.

CodeTypeDeclarationCollection

Type Parameter Elements

Type of source code element

Representative CodeDOM element

A type parameter of a generic type declaration, or a type argument of a constructed generic type.

CodeTypeParameter

A collection of type parameters or type arguments.

CodeTypeParameterCollection

Type Reference Elements

Type of source code element

Representative CodeDOM element

A reference to a type.

CodeTypeReference

A collection of references to types.

CodeTypeReferenceCollection

Represents how the code type reference is to be resolved.

CodeTypeReferenceOptions

Type Member Elements

Type of source code element

Representative CodeDOM element

An abstract base class that represents a member of a type.

CodeTypeMember

Represents a collection of members of a type.

CodeTypeMemberCollection

A class method declaration.

CodeMemberMethod

A class field declaration.

CodeMemberField

A class property declaration.

CodeMemberProperty

A constructor for a type.

CodeConstructor

A static constructor for a type.

CodeTypeConstructor

Represents the entry point of a program.

CodeEntryPoint

Represents attributes with identifiers that are used by CodeTypeMember.

MemberAttributes

Member Attributes

Type of source code element

Representative CodeDOM element

Represents member modifiers that are used by CodeTypeMember.

MemberAttributes

A custom attribute declaration.

CodeAttributeDeclaration

A custom attribute declaration collection.

CodeAttributeDeclarationCollection

A parameter declaration.

CodeParameterDeclarationExpression

A parameter declaration collection.

CodeParameterDeclarationExpressionCollection

An argument for a custom attribute.

CodeAttributeArgument

An argument for a custom attribute collection.

CodeAttributeArgumentCollection

Field direction modifiers

A directional expression.

CodeDirectionExpression

Represents the direction of an argument.

FieldDirection

Code Statements

Type of source code element

Representative CodeDOM element

The abstract base class for statements.

CodeStatement

A code statement collection.

CodeStatementCollection

A code expression that can be treated as a code statement.

CodeExpressionStatement

A variable declaration statement.

CodeVariableDeclarationStatement

Assignment operations

A statement that assigns a value.

CodeAssignStatement

Binary operations

An expression that represents a binary operator. A binary operator is an operator that uses two operands, usually termed the left and right operands.

CodeBinaryOperatorExpression

Represents a type of binary operator.

CodeBinaryOperatorType

Comments

A comment.

CodeComment

A comment statement.

CodeCommentStatement

A comment statement collection.

CodeCommentStatementCollection

Delegates and events

A class event declaration.

CodeMemberEvent

A delegate declaration.

CodeTypeDelegate

An expression that creates a delegate.

CodeDelegateCreateExpression

An expression that invokes a delegate.

CodeDelegateInvokeExpression

A statement that attaches a delegate for an event.

CodeAttachEventStatement

A statement that removes a delegate for an event.

CodeRemoveEventStatement

Error handling

A throw exception statement.

CodeThrowExceptionStatement

A try…catch…finally block.

CodeTryCatchFinallyStatement

A catch clause block.

CodeCatchClause

A catch clause block collection.

CodeCatchClauseCollection

Flow control statements

An if statement.

CodeConditionStatement

A for loop statement.

CodeIterationStatement

A goto statement.

CodeGotoStatement

A return value statement.

CodeMethodReturnStatement

A labeled statement.

CodeLabeledStatement

Code Expressions

Type of source code element

Representative CodeDOM element

The abstract base class for expressions.

CodeExpression

A code expression collection.

CodeExpressionCollection

An expression that casts an object or expression to a data type.

CodeCastExpression

A primitive value expression.

CodePrimitiveExpression

A typeof expression.

CodeTypeOfExpression

An array indexer.

CodeArrayIndexerExpression

A reference to an argument.

CodeArgumentReferenceExpression

A reference to a variable.

CodeVariableReferenceExpression

An expression that references a type.

CodeTypeReferenceExpression

An expression that represents the value argument of a property set.

CodePropertySetValueReferenceExpression

A reference to a default value for a type.

CodeDefaultValueExpression

Object creation

An expression that creates an object. For example, the new operator.

CodeObjectCreateExpression

An expression that creates an array.

CodeArrayCreateExpression

Method invocation

An expression that invokes a method.

CodeMethodInvokeExpression

Member references

A type indexer.

CodeIndexerExpression

A reference to a base class.

CodeBaseReferenceExpression

A reference to a field.

CodeFieldReferenceExpression

A reference to a method.

CodeMethodReferenceExpression

A reference to a property.

CodePropertyReferenceExpression

A reference to an event.

CodeEventReferenceExpression

A reference to the current object.

CodeThisReferenceExpression

Literal Snippets

Type of source code element

Representative CodeDOM element

A literal code compilable unit.

CodeSnippetCompileUnit

A literal code element that represents a class member.

CodeSnippetTypeMember

A literal code statement.

CodeSnippetStatement

A literal code element that represents an expression.

CodeSnippetExpression

Other

Type of source code element

Representative CodeDOM element

The abstract base class for CodeDOM objects.

CodeObject

Represents a location with a file name and line number.

CodeLinePragma

Represents a code checksum pragma code entity.

CodeChecksumPragma

The base class for code directive classes.

CodeDirective

A collection of code directives.

CodeDirectiveCollection

Specifies the name and mode for a code region.

CodeRegionDirective

Specifies the start and end of a code region.

CodeRegionMode

See Also

Tasks

How to: Create a Class Using CodeDOM

Reference

System.CodeDom

System.CodeDom.Compiler

Other Resources

Using CodeDOM to generate CSharp (C#) and VB code

General Reference for the .NET Framework

Dynamic Source Code Generation and Compilation