单例模式

 #region 1.0 单例类的写法

private static readonly MessageMgr _instance;
static MessageMgr()
{
   _instance = new MessageMgr();

}

private MessageMgr() { }

public static MessageMgr Instance
{
get
{
return _instance;
}
}

posted @ 2015-06-22 14:43  陌念  阅读(107)  评论(0编辑  收藏  举报