CodeAssignStatement Classe
Definição
Representa uma instrução de atribuição simples.Represents a simple assignment statement.
public ref class CodeAssignStatement : System::CodeDom::CodeStatement
public class CodeAssignStatement : System.CodeDom.CodeStatement
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeAssignStatement : System.CodeDom.CodeStatement
type CodeAssignStatement = class
inherit CodeStatement
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeAssignStatement = class
inherit CodeStatement
Public Class CodeAssignStatement
Inherits CodeStatement
- Herança
- Atributos
Exemplos
O código a seguir cria um CodeAssignStatement que atribui o valor 10 a uma variável de inteiro chamada i :The following code creates a CodeAssignStatement that assigns the value 10 to an integer variable named i :
// Assigns the value of the 10 to the integer variable "i".
CodeAssignStatement^ as1 = gcnew CodeAssignStatement( gcnew CodeVariableReferenceExpression( "i" ),gcnew CodePrimitiveExpression( 10 ) );
// A C# code generator produces the following source code for the preceeding example code:
// i=10;
// Assigns the value of the 10 to the integer variable "i".
CodeAssignStatement as1 = new CodeAssignStatement(new CodeVariableReferenceExpression("i"), new CodePrimitiveExpression(10));
// A C# code generator produces the following source code for the preceeding example code:
// i=10;
' Assigns the value 10 to the integer variable "i".
Dim as1 As New CodeAssignStatement(New CodeVariableReferenceExpression("i"), New CodePrimitiveExpression(10))
' A Visual Basic code generator produces the following source code for the preceeding example code:
' i = 10
Comentários
CodeAssignStatement pode ser usado para representar uma instrução que atribui o valor de um objeto a outro objeto ou uma referência a outra referência.CodeAssignStatement can be used to represent a statement that assigns the value of an object to another object, or a reference to another reference. As instruções de atribuição simples geralmente são do formato " value1 = value2 ", em que value1 o objeto está sendo atribuído e value2 está sendo atribuído.Simple assignment statements are usually of the form " value1 = value2 ", where value1 is the object being assigned to, and value2 is being assigned. A Left propriedade indica o objeto a ser atribuído.The Left property indicates the object to assign to. A Right propriedade indica o objeto a ser atribuído.The Right property indicates the object to assign.
Construtores
| CodeAssignStatement() |
Inicializa uma nova instância da classe CodeAssignStatement.Initializes a new instance of the CodeAssignStatement class. |
| CodeAssignStatement(CodeExpression, CodeExpression) |
Inicializa uma nova instância da classe CodeAssignStatement usando as expressões especificadas.Initializes a new instance of the CodeAssignStatement class using the specified expressions. |
Propriedades
| EndDirectives |
Obtém um objeto CodeDirectiveCollection que contém as diretivas de término.Gets a CodeDirectiveCollection object that contains end directives. (Herdado de CodeStatement) |
| Left |
Obtém ou define a expressão que representa o objeto ou uma referência à qual atribuir.Gets or sets the expression representing the object or reference to assign to. |
| LinePragma |
Obtém ou define a linha em que ocorre a declaração de código.Gets or sets the line on which the code statement occurs. (Herdado de CodeStatement) |
| Right |
Obtém ou define a expressão que representa o objeto ou uma referência a atribuir.Gets or sets the expression representing the object or reference to assign. |
| StartDirectives |
Obtém um objeto CodeDirectiveCollection que contém as diretivas de início.Gets a CodeDirectiveCollection object that contains start directives. (Herdado de CodeStatement) |
| UserData |
Obtém os dados definidos pelo usuário para o objeto atual.Gets the user-definable data for the current object. (Herdado de CodeObject) |
Métodos
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |