应用中的单例模式
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();
}
}
posted on 2010-06-26 17:27 o0myself0o 阅读(260) 评论(0) 收藏 举报
浙公网安备 33010602011771号