I want to preface that the easiest solution to this question is just to create another property with a different name, but I do not want to do that.
I have the following properties:
Public ReadOnly Property TotalApples() As Integer
Get
Return (mRedApples + mGreenApples)
End Get
End Property
Public Property RedApples() As Integer
Get
Return mRedApples
End Get
Set(ByVal value As Integer)
mRedApples = value
End Set
End Property
Public Property GreenApples() As Integer
Get
Return mGreenApples
End Get
Set(ByVal value As Integer)
mGreenApples = value
End Set
End Property
This works perfectly for what I need. However, sometimes I need to set the 'TotalApples' property manually and do not want to use the default calculation. The easiest way may be to change the exsisting property to be called 'TotalApplesCalculated' and then make 'TotalApples' a property that has the traditional Get/Set accessors.
I really just wanted to put this basic question out there to ask if there is a good way to use the one 'TotalApples' property, or if there is a better way to do this without using a second property.
Thanks! 