Implementing the Singleton Pattern in C#
http://www.yoda.arachsys.com/csharp/singleton.html
Five implementations are given. The author also compared their pros and cons.
Bestone is:
public sealed class Singleton
{
Singleton()
{
}
public static Singleton Instance
{
get
{
return Nested.instance;
}
}
class Nested
{
static Nested()
{
}
internal static readonly Singleton instance = new Singleton();
}
}