May 2010
Intermediate to advanced
1272 pages
61h 18m
English
In an object-oriented approach, fields should be wrapped by properties that gain access to fields. This happens also with shared members. Continuing with the preceding example, a shared property would be implemented as follows:

In this case the property is also marked as read-only because its value is incremented only when a new instance of the class is created, passing through the related field, but of course shared properties support both Get and Set. Because the preceding code offers a read-only property, you cannot take advantage of the new auto-implemented properties feature. If you do not need a read-only property, you ...
Read now
Unlock full access