6.10 Writing Properties
In C# name the property name should "shadow" the private variable name
that it represents differing only by case; Colour and colour for
example. But this would only apply when the variable that the property
represents is private, otherwise case-insensitive languages like
Visual Basic would have trouble accessing two members inside the type.
It is not possible to "shadow" the property name in Visual Basic, as
the language is case-insensitive. So the private variable can have an
alternate name or an underscore at the beginning, e.g. _colour.
[C#]
public string Colour
{
get
{
return colour;
}
set
{
colour = value;
}
}
[Visual Basic]
Public Property Colour As String
Get
Return _colour ' Can't use colour VB is case-insensitive
End Get
Set(ByVal _colour As String)
Me._colour = _colour
End Set
End Property