Пример #1
0
        private void ReloadPlansAndReschedule()
        {
            AllSchedulablePlans.Clear();

            BackupPlanRepository  daoBackupPlans  = new BackupPlanRepository();
            RestorePlanRepository daoRestorePlans = new RestorePlanRepository();

            AllSchedulablePlans.AddRange(daoBackupPlans.GetAllActive());
            AllSchedulablePlans.AddRange(daoRestorePlans.GetAllActive());

            // TODO(jweyrich): Currently does not DELETE existing tasks for plans that no longer exist.
            // TODO(jweyrich): Currently does not CHECK if an existing plan schedule has been changed.
            foreach (var plan in AllSchedulablePlans)
            {
                SchedulePlanExecution(plan, true);
            }
        }
Пример #2
0
        public void LoadPlans()
        {
            RemoveAllExceptRunning();

            var plans = dao.GetAllActive();

            foreach (var plan in plans)
            {
                if (ControlsAlreadyContainControlForPlan(plan))
                {
                    continue;
                }

                BackupPlanViewControl viewControl = new BackupPlanViewControl();
                viewControl.Model    = plan;
                viewControl.Deleted += (object sender, EventArgs e) =>
                {
                    BackupPlanViewControl control = sender as BackupPlanViewControl;
                    layoutPanel.Controls.Remove(control);
                };
                this.layoutPanel.Controls.Add(viewControl);
            }
        }