System.CodeDom.CodeVariableDeclarationStatement Class

Represents a variable declaration.

See Also: CodeVariableDeclarationStatement Members


public class CodeVariableDeclarationStatement : CodeStatement


System.CodeDom.CodeVariableDeclarationStatement can be used to represent code that declares a variable.

The CodeVariableDeclarationStatement.Type property specifies the type of the variable to declare. The CodeVariableDeclarationStatement.Name property specifies the name of the variable to declare. The CodeVariableDeclarationStatement.InitExpression property is optional, and specifies an initialization expression to assign to the variable after it is created.


Some languages can implement the optional variable initialization expression by making a separate assignment statement after the variable declaration.


Namespace: System.CodeDom
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,,