public ActiveListManagementWindow(IGauntletDbAdapter sqliteDb) { InitializeComponent(); //this._mySqlDb = mySqlDb; this._sqliteDb = sqliteDb; //LoadDbLists(mySqlDb); }
private void LoadDbLists(IGauntletDbAdapter db) { _activeCol = new ObservableCollection<ToDoList>(db.GetLists(true)); _inactiveCol = new ObservableCollection<ToDoList>(db.GetLists(false)); lvActive.ItemsSource = _activeCol; lvInactive.ItemsSource = _inactiveCol; IsChanged = false; tbDbName.Text = GetDbName(db); }
private string GetDbName(IGauntletDbAdapter db) { string name = "[unknown db]"; //if (db.Equals(_mySqlDb)) //{ // return "MySQL"; //} if (db.Equals(_sqliteDb)) { return "SQLite"; } return name; }
public void Configure(MenuController mc, IListMatrix ilm, IGauntletDbAdapter sqliteDb, StoryboardStatusBar statusBar) { this.ilm = ilm; this.sqliteDb = sqliteDb; this.statusBar = statusBar; mc.AddMenuItem("Gauntlet", "Export Active SQLite Lists To FileSystem Sync Folder", ExportActiveSqliteLists); //mc.AddMenuItem("Gauntlet", "Export Active MySQL Lists To FileSystem Sync Folder", ExportActiveMySqlLists); mc.AddMenuItem("Gauntlet", "Active List Management", ShowActiveListManagement); mc.AddMenuItem("Gauntlet", "Import Synced Files", ImportSyncedFiles); mc.AddMenuItem("Gauntlet", "Import Synced Archive Files", ImportSyncedArchiveFiles); mc.AddMenuItem("Gauntlet", "Consume All Imported Files", ConsumeAllImportedFiles); mc.AddMenuItem("Tools", "FileMatrix...", LaunchFileMatrix); mc.AddMenuItem("Tools", "ObjectGrid...", LaunchObjectGrid); }
public void ConfigureWithoutUI(IListMatrix ilm, IGauntletDbAdapter db) { this.ilm = ilm; //this.mysqlDb = db; this.statusBar = new StoryboardStatusBar(); //this prevents null exceptions where status is logged }
private void ExportActiveLists(IGauntletDbAdapter db) { int foundCount = 0; Configuration.EnsureDirectories(); foreach (ToDoList lst in db.GetLists(true)) { string phoneListPath = Configuration.GetPhoneSyncSynergyFilePath(lst.Name); string tabletListPath = Configuration.SynergyV3SyncFilePath("galaxy-a", lst.Name); string logosListPath = Configuration.SynergyV3SyncFilePath("logos", lst.Name); WriteListToPath(lst, phoneListPath, foundCount); WriteListToPath(lst, tabletListPath, foundCount); WriteListToPath(lst, logosListPath, foundCount); //if (!File.Exists(phoneListPath)) //{ // File.WriteAllLines(phoneListPath, lst.Items.ToFragmentArray()); //} //else //{ // foundCount++; //} //if (!File.Exists(tabletListPath)) //{ // File.WriteAllLines(tabletListPath, lst.Items.ToFragmentArray()); //} //else //{ // foundCount++; //} //if (!File.Exists(logosListPath)) //{ // File.WriteAllLines(logosListPath, lst.Items.ToFragmentArray()); //} //else //{ // foundCount++; //} } if (foundCount > 0) { MessageBox.Show(foundCount + " files already existed and were ignored. " + "To export fresh versions of all lists, first" + " consume all files then export again."); } statusBar.StatusBarText = "Files Exported."; }
private void UpdateDbActiveInactive(IGauntletDbAdapter db, IEnumerable<ToDoList> setToActive, IEnumerable<ToDoList> setToInactive) { db.UpdateActiveInactive(setToActive, setToInactive); try { LoadDbLists(db); } catch (Exception ex) { Display.Exception(ex); } }
private void UpdateDb(IGauntletDbAdapter db) { foreach (ToDoList tdl in _activeCol) { db.SetActive(tdl.Name, true); } foreach (ToDoList tdl in _inactiveCol) { db.SetActive(tdl.Name, false); } LoadDbLists(db); }