using System; public class Singleton<T> where T : class, new() { private static readonly T s_Instance; static Singleton() { s_Instance = Activator.CreateInstance<T>(); } public static T Instance { get { return s_Instance; } } }