CodeDirectionExpression Class
Represents an expression used as a method invoke parameter along with a reference direction indicator.
Assembly: System (in System.dll)
System.CodeDom::CodeObject
System.CodeDom::CodeExpression
System.CodeDom::CodeDirectionExpression
| Name | Description | |
|---|---|---|
![]() | CodeDirectionExpression() | Initializes a new instance of the CodeDirectionExpression class. |
![]() | CodeDirectionExpression(FieldDirection, CodeExpression^) | Initializes a new instance of the CodeDirectionExpression class using the specified field direction and expression. |
| Name | Description | |
|---|---|---|
![]() | Direction | Gets or sets the field direction for this direction expression. |
![]() | Expression | Gets or sets the code expression to represent. |
![]() | UserData | Gets the user-definable data for the current object.(Inherited from CodeObject.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
CodeDirectionExpression can represent a parameter passed to a method and the reference direction of the parameter.
The Expression property indicates the expression to qualify with a direction. The Direction property indicates the direction of the parameter using one of the FieldDirection enumeration values.
Note |
|---|
CodeDirectionExpression is intended to be used as a method invoke parameter, and should not be used when declaring methods. |
The following example demonstrates use of a CodeDirectionExpression to specify a field direction modifier for an expression to pass as a method parameter.
// Declares a parameter passed by reference using a CodeDirectionExpression. array<CodeDirectionExpression^>^param1 = {gcnew CodeDirectionExpression( FieldDirection::Ref,gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"TestParameter" ) )}; // Invokes a method on this named TestMethod using the direction expression as a parameter. CodeMethodInvokeExpression^ methodInvoke1 = gcnew CodeMethodInvokeExpression( gcnew CodeThisReferenceExpression,"TestMethod",param1 ); // A C# code generator produces the following source code for the preceeding example code: // this.TestMethod(ref TestParameter);
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.



