// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; namespace Singleton { public class SimpleSingleton { private static readonly SimpleSingleton instance = new SimpleSingleton(); private int someState; private SimpleSingleton() { someState = 123; } public static SimpleSingleton Instance { get { return instance; } } public void SomeMethod() { Console.WriteLine(someState); } } }