标签:
/// <summary>
/// 创建单例对象
/// </summary>
/// <typeparam name="T"></typeparam>
public sealed class Singleton<T> where T : new()
{
/// <summary>
/// 单例对象
/// </summary>
public static readonly T Instance;
/// <summary>
/// 静态构造
/// </summary>
static Singleton()
{
Instance = new T();
}
}
标签:
原文地址:http://www.cnblogs.com/zhshlimi/p/5497113.html