Is there a particular scenario where a WriteOnly property makes more sense then a method? The method approach feels much more natural to me. What is the right approach?
Public WriteOnly Property MyProperty As String
Set(ByVal value as String)
m_myField = value
End Set
End Property
public string MyProperty
{
set{ m_myField = value;}
}
VS
Public Sub SetMyProperty(ByVal value as String)
m_myField = value
End Sub
public void SetMyProperty(string value)
{
m_myField = value;
}
EDIT Just to clarify I am referring to "WriteOnly" properties.