Ejemplo n.º 1
0
        /// <summary>
        /// 为了缓存问题,需要执行关闭连接再打开连接
        /// </summary>
        /// <param name="needclose"></param>
        /// <returns></returns>
        public static pSpaceHelper Instance(bool needclose)
        {
            if (_mInstance == null) {
                _mInstance = new pSpaceHelper();
                _mInstance.Connection();
                //if (!_mInstance.Connection()) {
                //    _mInstance.Dispose();
                //    return null;
                //}
            }
            //if (needclose) {
            //    _mInstance.Dispose();
            //}
            //else {
            //    _mInstance = new pSpaceHelper();
            //}

            return _mInstance;
        }
Ejemplo n.º 2
0
        public void Dispose()
        {
            try {

                if (null != dbConnector && dbConnector.IsConnected()) {
                    dbConnector.Disconnect();
                }
                //Common.StopAPI();
            }
            catch (Exception) {

            }
            _mInstance = null;
            tagTree = null;
            tagManager = null;
            dbConnector = null;
            rootNode = null;
            realSubscriber = null;
            //Common.StopAPI();
        }