Generating Shared Members

Visual Studio is intelligent enough to understand whenever you try to define a shared member. For example, imagine you want to implement a method that returns the number of active instances of the Person class. If you type the following code:

Person.ReturnInstanceCount()

and then select the Generate method stub correction option, Visual Studio generates the following code:

image

Get Visual Basic® 2010 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.