CodeExpressionStatement Class
Represents a statement that consists of a single expression.
Assembly: System (in System.dll)
A CodeExpressionStatement contains a CodeExpression object, and it can be added to a CodeStatementCollection object, allowing some expressions to stand alone. For example, a CodeMethodInvokeExpression contained by a CodeExpressionStatement can represent a method call without a return value.
The following example demonstrates how to create an instance of the CodeExpressionStatement class by using a CodeExpression object.
' Creates a code expression for a CodeExpressionStatement to contain. Dim invokeExpression = New CodeMethodInvokeExpression( _ New CodeTypeReferenceExpression("Console"), "Write", _ New CodePrimitiveExpression("Example string")) ' Creates a statement using a code expression. Dim expressionStatement As CodeExpressionStatement expressionStatement = New CodeExpressionStatement(invokeExpression) ' A C# code generator produces the following source code for the preceeding example code: ' Console.Write( "Example string" );
System.CodeDom.CodeObject
System.CodeDom.CodeStatement
System.CodeDom.CodeExpressionStatement
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.