Пример #1
0
        public static void ShowBackupStorage(BackupFileInfo info)
        {
            var dialog = new BackupStorage();

            dialog.SetInfo(info);
            dialog.ShowDialog();
            dialog.Dispose();
        }
Пример #2
0
        public void SetInfo(BackupFileInfo info)
        {
            _info        = info;
            _tableSource = new BindingSource();
            var backupFiles = _info.GetBackupFiles();

            list.Clear();
            backupFiles.ForEach(b => list.Add(new BackupStorageFileInfo(b)));
            _tableSource.DataSource = list;
            dataGridView.DataSource = _tableSource;
            dataGridView.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }
Пример #3
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var ff = new BackupFileInfo()
            {
                FileName = openFileDialog1.FileName
            };

            ff.ShowSettings();
            ff.Notivicator = notifycator;
            Files.Add(ff);
            _tableSource.ResetBindings(false);
            SaveSettings();
        }
Пример #4
0
        public static void ShowSettingsDialog(BackupFileInfo info)
        {
            var dialog = new SettingsDialog();

            dialog.byAuto.Checked               = info.UseWatch;
            dialog.byTimer.Checked              = !info.UseWatch;
            dialog.TimerBox.Text                = info.Interval.ToString();
            dialog.RepoGlobalFolder.Checked     = info.RepoGlobalFolder;
            dialog.RepoNearSourceFolder.Checked = info.RepoNearSourceFolder;
            dialog.RepoUserFolder.Checked       = info.RepoUserFolder;
            dialog.tbFolder.Text                = info.UserFolder;
            dialog.tbMaxCount.Text              = info.MaxCount.ToString();
            dialog.ShowDialog();
            info.UseWatch             = dialog.byAuto.Checked;
            info.Interval             = int.Parse(dialog.TimerBox.Text);
            info.RepoGlobalFolder     = dialog.RepoGlobalFolder.Checked;
            info.RepoNearSourceFolder = dialog.RepoNearSourceFolder.Checked;
            info.RepoUserFolder       = dialog.RepoUserFolder.Checked;
            info.UserFolder           = dialog.tbFolder.Text;
            info.MaxCount             = int.Parse(dialog.tbMaxCount.Text);
        }