namespace ChadSoft { /// /// Implements a generic Singleton pattern /// /// public abstract class Singleton where T : class, new() { class SingletonCreator { static SingletonCreator() { } internal static readonly T instance = new T(); } /// /// The singleton instance of this class /// public static T Instance { get { return SingletonCreator.instance; } } } }