M
miben
I need to set a variable returned by a readonly property in a class by
another class. So the only way to set that value is from a specific
class and function.
Public Sub Main
Dim setter As New GoingToSetYou
Dim item As New ToBeSet
setter.NewItem(item)
Dim sValue As String = item.Value
End Sub
Public Class GoingToSetYou
Public Function NewItem(item As ToBeSet)
I want to set the private variable m_sValue here some how and
keep the access of it away from others
End Function
End Class
Public Class ToBeSet
Private m_sValue As String
Public ReadOnly Property Value As String
Return m_sValue
End Property
End Class
another class. So the only way to set that value is from a specific
class and function.
Public Sub Main
Dim setter As New GoingToSetYou
Dim item As New ToBeSet
setter.NewItem(item)
Dim sValue As String = item.Value
End Sub
Public Class GoingToSetYou
Public Function NewItem(item As ToBeSet)
I want to set the private variable m_sValue here some how and
keep the access of it away from others
End Function
End Class
Public Class ToBeSet
Private m_sValue As String
Public ReadOnly Property Value As String
Return m_sValue
End Property
End Class