CodePropertySetValueReferenceExpression Class
Represents the value argument of a property set method call within a property set method.
Assembly: System (in System.dll)
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. Dim type1 As New CodeTypeDeclaration("Type1") ' Declares a constructor. Dim constructor1 As New CodeConstructor() constructor1.Attributes = MemberAttributes.Public type1.Members.Add(constructor1) ' Declares an integer field. Dim field1 As New CodeMemberField("System.Int32", "integerField") type1.Members.Add(field1) ' Declares a property. Dim property1 As New CodeMemberProperty() ' Declares a property get statement to return the value of the integer field. property1.GetStatements.Add(New CodeMethodReturnStatement(New CodeFieldReferenceExpression(New 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(New CodeAssignStatement(New CodeFieldReferenceExpression(New CodeThisReferenceExpression(), "integerField"), New CodePropertySetValueReferenceExpression())) type1.Members.Add(property1) ' A Visual Basic code generator produces the following source code for the preceeding example code: ' Public Class Type1 ' ' Private integerField As Integer ' ' Public Sub New() ' MyBase.New() ' End Sub ' ' Private Property integerProperty() As Integer ' Get ' Return Me.integerField ' End Get ' Set(ByVal Value As Integer) ' Me.integerField = value ' End Set ' End Property ' End Class
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodePropertySetValueReferenceExpression
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.