using System; public class Singleton { protected static readonly T ms_instance = Activator.CreateInstance(); public static T Instance { get { return Singleton.ms_instance; } } protected Singleton() { this.OnInstanceCreate(); } protected virtual void OnInstanceCreate() { } }