Beispiel #1
0
 //---------------------------------------------------------------------
 public void Update(float tm)
 {
     try
     {
         if (QueLoadTbName.Count > 0)
         {
             var tb_name = QueLoadTbName.Dequeue();
             _loadTable(tb_name);
             UpdateCallBack(TotalTbCount - QueLoadTbName.Count, TotalTbCount);
         }
         else
         {
             if (FinishedCallBack != null)
             {
                 Sqlite.closeDb();
                 var call_back = FinishedCallBack;
                 FinishedCallBack = null;
                 call_back();
             }
         }
     }
     catch (Exception e)
     {
         EbLog.Note(e.ToString());
     }
 }
Beispiel #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());
            }
        }
Beispiel #3
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)
            {
            }
        }