using System; namespace XUtliPoolLib { public abstract class XSingleton : XBaseSingleton where T : new() { public static T singleton { get { return XSingleton._instance; } } private static readonly T _instance = Activator.CreateInstance(); protected XSingleton() { bool flag = XSingleton._instance != null; if (flag) { T instance = XSingleton._instance; throw new XDoubleNewException(instance.ToString() + " can not be created again."); } } public override bool Init() { return true; } public override void Uninit() { } } }