CodePropertySetValueReferenceExpression Class
Represents the value argument of a property set method call within a property set method.
System.CodeDom::CodeObject
System.CodeDom::CodeExpression
System.CodeDom::CodePropertySetValueReferenceExpression
Assembly: System (in System.dll)
The CodePropertySetValueReferenceExpression type exposes the following members.
| 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 a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | 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; // } // } // }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
