一、单例模式
namespace DesignPattern
{
public class Single_Pattern
{
private static Single_Pattern single_Pattern = null;
private static object syncObject = new object();
public static Single_Pattern Instance
{
get
{
lock (syncObject)
{
if (single_Pattern == null)
{
single_Pattern = new Single_Pattern();
}
}
return single_Pattern;
}
}
}
}