CodeExpressionStatement Constructores

Definición

Inicializa una nueva instancia de la clase CodeExpressionStatement.

Sobrecargas

CodeExpressionStatement()

Inicializa una nueva instancia de la clase CodeExpressionStatement.

CodeExpressionStatement(CodeExpression)

Inicializa una nueva instancia de la clase CodeExpressionStatement usando la expresión especificada.

CodeExpressionStatement()

Source:
CodeExpressionStatement.cs
Source:
CodeExpressionStatement.cs
Source:
CodeExpressionStatement.cs

Inicializa una nueva instancia de la clase CodeExpressionStatement.

public:
 CodeExpressionStatement();
public CodeExpressionStatement ();
Public Sub New ()

Se aplica a

CodeExpressionStatement(CodeExpression)

Source:
CodeExpressionStatement.cs
Source:
CodeExpressionStatement.cs
Source:
CodeExpressionStatement.cs

Inicializa una nueva instancia de la clase CodeExpressionStatement usando la expresión especificada.

public:
 CodeExpressionStatement(System::CodeDom::CodeExpression ^ expression);
public CodeExpressionStatement (System.CodeDom.CodeExpression expression);
new System.CodeDom.CodeExpressionStatement : System.CodeDom.CodeExpression -> System.CodeDom.CodeExpressionStatement
Public Sub New (expression As CodeExpression)

Parámetros

expression
CodeExpression

CodeExpression para la instrucción.

Ejemplos

En el ejemplo siguiente se crea un CodeExpression objeto y se usa como parámetro para inicializar una instancia de la CodeExpressionStatement clase .

// Creates a code expression for a CodeExpressionStatement to contain.
array<CodeExpression^>^ temp = {gcnew CodePrimitiveExpression( "Example string" )};
CodeExpression^ invokeExpression = gcnew CodeMethodInvokeExpression(
   gcnew CodeTypeReferenceExpression( "Console" ),"Write",temp );

// Creates a statement using a code expression.
CodeExpressionStatement^ expressionStatement;
expressionStatement = gcnew CodeExpressionStatement( invokeExpression );

// A C++ code generator produces the following source code for the preceeding example code:

// Console::Write( "Example string" );
// Creates a code expression for a CodeExpressionStatement to contain.
CodeExpression invokeExpression = new CodeMethodInvokeExpression(
    new CodeTypeReferenceExpression("Console"),
    "Write", new CodePrimitiveExpression("Example string") );

// Creates a statement using a code expression.
CodeExpressionStatement expressionStatement;
expressionStatement = new CodeExpressionStatement( invokeExpression );

// A C# code generator produces the following source code for the preceeding example code:

// Console.Write( "Example string" );
' 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" );

Se aplica a