CodePropertySetValueReferenceExpression Class
Represents the value argument of a property set method call within a property set method.
Assembly: System (in System.dll)
System.CodeDom::CodeObject
System.CodeDom::CodeExpression
System.CodeDom::CodePropertySetValueReferenceExpression
| Name | Description | |
|---|---|---|
![]() | CodePropertySetValueReferenceExpression() | Initializes a new instance of the CodePropertySetValueReferenceExpression class. |
| Name | Description | |
|---|---|---|
![]() | 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.) |
CodePropertySetValueReferenceExpression represents the value argument of a property set method call within a property set method declaration.
A property set method typically assigns or uses the value assigned to the property. Within the property set method, this value is represented by an implicit variable represented in CodeDOM by a CodePropertySetValueReferenceExpression.
This example demonstrates use of a CodePropertySetValueReferenceExpression to represent the value argument passed to a property set value statement block.
// Declares a type. CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "Type1" ); // Declares a constructor. CodeConstructor^ constructor1 = gcnew CodeConstructor; constructor1->Attributes = MemberAttributes::Public; type1->Members->Add( constructor1 ); // Declares an integer field. CodeMemberField^ field1 = gcnew CodeMemberField( "System.Int32","integerField" ); type1->Members->Add( field1 ); // Declares a property. CodeMemberProperty^ property1 = gcnew CodeMemberProperty; // Declares a property get statement to return the value of the integer field. property1->GetStatements->Add( gcnew CodeMethodReturnStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"integerField" ) ) ); // Declares a property set statement to set the value to the integer field. // The CodePropertySetValueReferenceExpression represents the value argument passed to the property set statement. property1->SetStatements->Add( gcnew CodeAssignStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"integerField" ),gcnew CodePropertySetValueReferenceExpression ) ); type1->Members->Add( property1 ); // A C# code generator produces the following source code for the preceeding example code: // public class Type1 // { // // private int integerField; // // public Type1() // { // } // // private int integerProperty // { // get // { // return this.integerField; // } // set // { // this.integerField = value; // } // } // }
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.


