[阅读: 901] 2008-07-02 23:12:27
public class Singleton<T> where T: new()
{
// Instead of compile time check, we provide a run time check
// to make sure there is only one instance.
protected Singleton(){Debug.Assert(null == instance);}
protected static T instance = new T();
public static T Instance
{
get{return instance;}
}
}
机器人,
这首歌学会了没有?
我们的目标是->没有蛀牙!