Beispiel #1
0
        //TODO: select between FOS and NoSQL
        public static void InitiateDB(decimal dbType, string path1, string path2,LogDispatcher.LogDispatcher log)
        {
            _log = log;
            if (path1 == "" || path2 == "") return;

            if (AccDB != null)
            {
                AccDB.Scan.ProgressChanged -= _accDB_ProgressChanged;
                AccDB.StateChanged -= _accDB_StateChanged;
                AccDB.CloseDB();
            }

            AccDB = new NoSQLDB(path1, path2,log);
            AccDB.Scan.ProgressChanged += _accDB_ProgressChanged;
            AccDB.StateChanged += _accDB_StateChanged;
            AccDB.Retriever.GetFinish += AccDB_OnGetFinish;
            AccDB.Queue.Committed += Queue_Committed;
            AccDB.Queue.SetThreshold((int)Properties.Settings.Default.TuneQThreshold);
            AccDB.Queue.SetTimeout((int)Properties.Settings.Default.TuneQTimer);
            AccDB.Scan.AccountScanned += Scan_AccountScanned;
            _path1 = path1;

            if (!IsDBAvailable())
            {
                //Database not found/set up
                var set = new Settings(log);
                set.ShowDialog();
                return;
            }

            if (DBCountRows("Accounts") != 0) return;
            if (MessageBox.Show(
                @"DB is not initialized. Initialize and scan now?",
                @"Database is empty",
                MessageBoxButtons.YesNo) != DialogResult.Yes) return;
            //Database is empty
            RescanDB(Properties.Settings.Default.DBAggressiveScan);
        }
Beispiel #2
0
 public Scanner(SQLiteConnection conn,NoSQLDB db)
 {
     _conn = conn;
     _db = db;
 }
Beispiel #3
0
 public BanDB(NoSQLDB db)
 {
     _db = db;
 }