Exemplo n.º 1
0
        //---------------------------------------------------------------------
        public void Setup(string db_filename)
        {
#if UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER
            Sqlite = new SqliteUnity(db_filename);
#else
            Sqlite = new SqliteWin();
#endif
            if (!Sqlite.openDb(db_filename))
            {
                EbLog.Note("EbDataMgr.setup() failed! Can not Open File! db_filename=" + db_filename);
                return;
            }

            try
            {
                // 加载所有Table数据
                HashSet <string> list_tablename = _loadAllTableName();
                foreach (var i in list_tablename)
                {
                    _loadTable(i);
                }

                Sqlite.closeDb();
            }
            catch (Exception e)
            {
                EbLog.Note(e.ToString());
            }
        }
Exemplo n.º 2
0
        //---------------------------------------------------------------------
        public void Setup(string db_filename, Action <int, int> update_callback, Action finished_callback)
        {
            UpdateCallBack   = update_callback;
            FinishedCallBack = finished_callback;

#if UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER
            Sqlite = new SqliteUnity(db_filename);
#else
            Sqlite = new SqliteWin();
#endif
            if (!Sqlite.openDb(db_filename))
            {
                EbLog.Note("EbDataMgr.setup() failed! Can not Open File! db_filename=" + db_filename);
                return;
            }

            try
            {
                // 加载所有Table数据
                HashSet <string> list_tablename = _loadAllTableName();
                foreach (var i in list_tablename)
                {
                    QueLoadTbName.Enqueue(i);
                }
                TotalTbCount = QueLoadTbName.Count;
            }
            catch (Exception e)
            {
                EbLog.Note(e.ToString());
            }
        }
Exemplo n.º 3
0
        //---------------------------------------------------------------------
        public void Setup(string db_filename)
        {
#if UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER
            Sqlite = new SqliteUnity();
#else
            Sqlite = new SqliteWin();
#endif
            if (!Sqlite.openDb(db_filename))
            {
                return;
            }

            try
            {
                // 加载所有Table数据
                List <string> list_tablename = _loadAllTableName();
                foreach (var i in list_tablename)
                {
                    _loadTable(i);
                }

                Sqlite.closeDb();
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 4
0
        //---------------------------------------------------------------------
        public Dictionary <string, byte[]> Setup(string db_name, byte[] db_data)
        {
            Dictionary <string, byte[]> map_table = new Dictionary <string, byte[]>();

#if UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER
            Sqlite = new SqliteUnity(db_filename);
#else
            Sqlite = new SqliteWin();
#endif

            MemoryStream ms = new MemoryStream(db_data);
            if (!Sqlite.openDb(db_name, ms))
            {
                EbLog.Note("EbDataMgr.setup() failed! Can not Open Stream!");
                ms.Close();
                return(map_table);
            }

            // 加载所有Table数据
            HashSet <string> list_tablename = _loadAllTableName();
            foreach (var i in list_tablename)
            {
                _loadTable(i);
                map_table[i] = GetTableAsBytes(i);
            }

            Sqlite.closeDb();
            ms.Close();

            return(map_table);
        }
Exemplo n.º 5
0
        //---------------------------------------------------------------------
        public void Setup(string db_filename, Action <int, int> update_callback, Action finished_callback)
        {
            UpdateCallBack   = update_callback;
            FinishedCallBack = finished_callback;

#if UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER
            Sqlite = new SqliteUnity();
#else
            Sqlite = new SqliteWin();
#endif
            if (!Sqlite.openDb(db_filename))
            {
                return;
            }

            try
            {
                // 加载所有Table数据
                List <string> list_tablename = _loadAllTableName();
                foreach (var i in list_tablename)
                {
                    QueLoadTbName.Enqueue(i);
                }
                TotalTbCount = QueLoadTbName.Count;
            }
            catch (Exception)
            {
            }
        }