コード例 #1
0
        private void AddPlanTButtonClick(object sender, EventArgs e)
        {
            var dlg = new PlanEditor {
                Text     = "Add New Backup Plan",
                PlanName = "Untitled Plan"
            };

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                var plan = new BackupPlan.BackupPlan(dlg.PlanName, dlg.SourceFolder, dlg.DestinationFolder, null, AddLogEntry);
                AddPlan(plan);
            }
        }
コード例 #2
0
        private void EditPlanButtonClick(object sender, EventArgs e)
        {
            BackupPlan.BackupPlan plan = (BackupPlan.BackupPlan)planListView_.SelectedItems[0].Tag;
            var dlg = new PlanEditor {
                Text              = "Edit Backup Plan",
                PlanName          = plan.Name,
                EnableSource      = false,
                EnableDestination = false,
                SourceFolder      = plan.FolderToBackup,
                DestinationFolder = plan.DestinationFolder
            };

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                plan.Name = dlg.Name;
                SavePlans();
            }
        }