Export (0) Print
Expand All

CodeAssignStatement Class

Represents a simple assignment statement.

Namespace: System.CodeDom
Assembly: System (in system.dll)

[SerializableAttribute] 
[ComVisibleAttribute(true)] 
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
public class CodeAssignStatement : CodeStatement
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
public class CodeAssignStatement extends CodeStatement
SerializableAttribute 
ComVisibleAttribute(true) 
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
public class CodeAssignStatement extends CodeStatement
Not applicable.

CodeAssignStatement can be used to represent a statement that assigns the value of an object to another object, or a reference to another reference. Simple assignment statements are usually of the form " value1 = value2 ", where value1 is the object being assigned to, and value2 is being assigned. The Left property indicates the object to assign to. The Right property indicates the object to assign.

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 = 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 of the 10 to the integer variable "i".
CodeAssignStatement as1 =
    new CodeAssignStatement(new CodeVariableReferenceExpression("i"),
    new CodePrimitiveExpression((Int32)10));

// A VJ# code generator produces the following source code for the
// preceeding example code:
// i=10;

System.Object
   System.CodeDom.CodeObject
     System.CodeDom.CodeStatement
      System.CodeDom.CodeAssignStatement

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft