Rules About Properties

The CLS provides a couple of rules about properties implementation:

Image All properties exposed by a class must have the same access level, meaning that they must be all instance properties or all shared properties or all virtual properties. Virtual properties (that is, marked with the MustOverride keyword) are described in Chapter 12.

Image Get, Set, and the property itself must return and receive the same type; the type must also be CLS-compliant. If the property returns String, both Get and Set must handle String, too. The type must ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.