コード例 #1
0
        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.";
        }
コード例 #2
0
        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);
        }