namespace Framework.Systems
{
/// <summary>
/// 单实例类基类
/// </summary>
public class SingletonProvider<T> where T : new()
{
SingletonProvider() { }
public static T Instance
{
get { return SingletonCreator.instance; }
}
class SingletonCreator
{
static SingletonCreator() { }
internal static readonly T instance = new T();
}
}
}
SingletonProvider<T>
最新推荐文章于 2019-02-01 09:09:45 发布