NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

8.5.1 Shared data members

A data member declared with the Shared modifier is a shared data member. A shared data member identifies exactly one storage location. No matter how many instances of a type are created, there is only ever one copy of a shared data member. A shared data member comes into existence when a program begins executing, and ceases to exist when the program terminates. A shared data member is initialized to the default value of its type.

A data member declared without the Shared modifier is called an instance data member. Every instance of a class contains a separate copy of all instance data members of the class. An instance data member is initialized to the default value of its type. An instance data member of a reference type comes into existence when a new instance of that type is created, and ceases to exist when there are no references to that instance and the Finalize method has executed. An instance data member of a value type has exactly the same lifetime as the variable to which it belongs. In other words, when a variable of a value type comes into existence or ceases to exist, so do the instance data members of the value type.