I wonder if there is a mechanism or pattern to allow only one instance of a class in C#. I have heard of the Singleton class, but i don\'t know how to use it we
Singleton
Singleton is not a class, but rather a pattern. Here is an example:
class Singleton { private Singleton() {} static private Singleton GetIt() { return theOne; } static private Singleton theOne = new Singleton(); }