Exemplo n.º 1
0
 public static void Refresh()
 {
     lock (olock)
     {
         instance = new XiHuan_GoodsTypeFacade();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 生成实例方法
        /// </summary>
        /// <returns></returns>
        public static XiHuan_GoodsTypeFacade GetInstance()
        {
            if (instance == null)
            {
                //取得实例的时候先锁定对象,然后判定是否存在
                lock (olock)
                {
                    //如果实例没有被初始化则实例化变量
                    if (instance == null)
                    {
                        instance = new XiHuan_GoodsTypeFacade();
                    }
                }
            }

            return(instance);
        }