July 2015
Intermediate to advanced
1300 pages
87h 27m
English
It’s not unusual to give a class the capability of exposing data but not of modifying such data. Continuing the example of the Person class, imagine you want to expose the FirstName and LastName properties plus a FullName property that returns the full name of the person. This property should be marked as read-only because only the FirstName and LastName properties should be editable and FullName is the result of the concatenation of these two properties. You can therefore define a read-only property as follows:
Public Class Person Public Property FirstName As String Public Property LastName As String Public ReadOnly Property FullName As String Get Return Me.FirstName ...