Пример #1
0
 public void Restore(Schedule schedule, DateTime when, string where)
 {
     ExecuteTask(new RestoreTask(schedule, where, when));
 }
Пример #2
0
 public string[] ListBackups(Schedule schedule)
 {
     ListBackupsTask task = new ListBackupsTask(schedule);
     ExecuteTask(task);
     return task.Backups;
 }
Пример #3
0
        public List<KeyValuePair<Library.Main.RSync.RSyncDir.PatchFileType, string>> ListActualFiles(Schedule schedule, DateTime when)
        {
            ListActualFilesTask task = new ListActualFilesTask(schedule, when);
            ExecuteTask(task);

            if (task.IsAborted)
                return null;

            if (task.Result.StartsWith("Error:"))
                throw new Exception(task.Result);

            return task.Files;
        }
Пример #4
0
        public string[] ListBackups(Schedule schedule)
        {
            ListBackupsTask task = new ListBackupsTask(schedule);
            ExecuteTask(task);

            if (task.IsAborted)
                return null;

            return task.Backups;
        }
Пример #5
0
        void SelectBackup_PageLeave(object sender, PageChangedArgs args)
        {
            if (args.Direction == PageChangedDirection.Back)
                return;

            if ((RestoreExisting.Checked && BackupList.SelectedBackup == null) || (!RestoreExisting.Checked && !DirectRestore.Checked))
            {
                MessageBox.Show(this, Strings.SelectBackup.NoActionSelected, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                args.Cancel = true;
                return;
            }

            if (DirectRestore.Checked)
            {
                m_wrapper.SetupDefaults();
                m_wrapper.DataConnection = new System.Data.LightDatamodel.DataFetcherNested(Program.DataConnection);

                Schedule s = new Schedule();
                Task t = new Task();

                m_wrapper.DataConnection.Add(s);
                m_wrapper.DataConnection.Add(t);

                s.Task = t;

                m_wrapper.ScheduleID = s.ID;
                m_wrapper.PrimayAction = WizardSettingsWrapper.MainAction.Restore;
            }
            else
                m_wrapper.ReflectSchedule(BackupList.SelectedBackup);

            switch (m_wrapper.PrimayAction)
            {
                case WizardSettingsWrapper.MainAction.Edit:
                    args.NextPage = new Add_backup.SelectName();
                    break;
                case WizardSettingsWrapper.MainAction.Remove:
                    args.NextPage = new Delete_backup.DeleteFinished();
                    break;
                case WizardSettingsWrapper.MainAction.Restore:
                    m_wrapper.ShowAdvancedRestoreOptions = ShowAdvanced.Checked;
                    if (DirectRestore.Checked)
                        args.NextPage = new Add_backup.PasswordSettings();
                    else
                        args.NextPage = m_wrapper.ShowAdvancedRestoreOptions ? (IWizardControl)new Add_backup.SettingOverrides() : (IWizardControl)new Restore.SelectBackupVersion();
                    break;
                case WizardSettingsWrapper.MainAction.RunNow:
                    args.NextPage = new RunNow.RunNowFinished();
                    break;
                default:
                    args.NextPage = null;
                    args.Cancel = true;
                    return;
            }
        }
Пример #6
0
 public void FullBackup(Schedule schedule)
 {
     PerformBackup(schedule, true, null);
 }
Пример #7
0
 public BackupTask(Schedule schedule)
 {
     m_schedule = schedule;
 }
Пример #8
0
 public RemoveOlderThanTask(Schedule schedule, string older)
     : base(schedule)
 {
     m_older = older;
     base.TaskCompleted += new TaskCompletedHandler(DoneEvent);
 }
Пример #9
0
 public RestoreTask(Schedule schedule, string targetdir)
     : this(schedule, targetdir, null, new DateTime())
 {
 }
Пример #10
0
 public RestoreTask(Schedule schedule, string targetdir, string sourcefiles, DateTime when)
     : base(schedule)
 {
     m_targetdir = targetdir;
     m_sourceFiles = sourcefiles;
     m_when = when;
     base.TaskCompleted += new TaskCompletedHandler(DoneEvent);
 }
Пример #11
0
 public RestoreTask(Schedule schedule, string targetdir, DateTime when)
     : this(schedule, targetdir, null, when)
 {
 }
Пример #12
0
 public RestoreTask(Schedule schedule, string targetdir, string sourcefiles)
     : this(schedule, targetdir, sourcefiles, new DateTime())
 {
 }
Пример #13
0
        public void LoadFileList(Schedule schedule, DateTime when, List<string> filelist, List<string> targetFolders, string defaultTarget)
        {
            //backgroundWorker.CancelAsync();
            LoadingIndicator.Visible = true;
            progressBar.Visible = true;
            treeView.Visible = false;
            treeView.TreeViewNodeSorter = new NodeSorter();
            LoadingIndicator.Text = m_localizedLoadingText;

            m_files = filelist;
            m_when = when;
            m_schedule = schedule;
            m_defaultTarget = defaultTarget;
            m_targetfolders = targetFolders;
            m_rootnodes = null;

            if (!backgroundWorker.IsBusy)
                backgroundWorker.RunWorkerAsync();
        }
Пример #14
0
 public ListSourceFoldersTask(Schedule schedule, DateTime when)
     : base(schedule, when)
 {
 }
Пример #15
0
 public FullBackupTask(Schedule schedule)
     : base(schedule)
 {
 }
Пример #16
0
 public RemoveAllButNFullTask(Schedule schedule, int fullcount)
     : base(schedule)
 {
     m_fullCount = fullcount;
     base.TaskCompleted += new TaskCompletedHandler(DoneEvent);
 }
Пример #17
0
 protected FullOrIncrementalTask(Schedule schedule)
     : base(schedule)
 {
     base.TaskCompleted += new TaskCompletedHandler(DoneEvent);
 }
Пример #18
0
 public RestoreSetupTask(Schedule schedule, string targetdir)
     : base(schedule)
 {
     m_targetdir = targetdir;
 }
Пример #19
0
 public IncrementalBackupTask(Schedule schedule, string fullAfter)
     : this(schedule)
 {
     m_fullAfter = fullAfter;
 }
Пример #20
0
 public void Setup(Schedule schedule)
 {
     m_schedule = schedule;
     backupItems.Setup(schedule);
 }
Пример #21
0
 public IncrementalBackupTask(Schedule schedule)
     : base(schedule)
 {
 }
Пример #22
0
 public void IncrementalBackup(Schedule schedule)
 {
     PerformBackup(schedule, false, null);
 }
Пример #23
0
 public ListBackupEntriesTask(Schedule schedule)
     : base(schedule)
 {
 }
Пример #24
0
        public List<ManifestEntry> ListBackupEntries(Schedule schedule)
        {
            ListBackupEntriesTask task = new ListBackupEntriesTask(schedule);
            ExecuteTask(task);

            if (task.IsAborted)
                return null;

            if (task.Result.StartsWith("Error:"))
                throw new Exception(task.Result);

            return task.Backups;
        }
Пример #25
0
 public ListBackupsTask(Schedule schedule)
     : base(schedule)
 {
     this.TaskCompleted += new TaskCompletedHandler(ListBackupsTask_TaskCompleted);
 }
Пример #26
0
        public IList<string> ListSourceFolders(Schedule schedule, DateTime when)
        {
            ListSourceFoldersTask task = new ListSourceFoldersTask(schedule, when);
            ExecuteTask(task);

            if (task.IsAborted)
                return null;

            if (task.Result.StartsWith("Error:"))
                throw new Exception(task.Result);

            return task.Files;
        }
Пример #27
0
 public ListFilesTask(Schedule schedule, DateTime when)
     : base(schedule)
 {
     m_when = when;
 }
Пример #28
0
 private void PerformBackup(Schedule schedule, bool forceFull, string fullAfter)
 {
     if (forceFull)
         ExecuteTask(new FullBackupTask(schedule));
     else
         ExecuteTask(new IncrementalBackupTask(schedule, fullAfter));
 }
Пример #29
0
        public void Setup(Schedule schedule)
        {
            m_schedule = schedule;
            WaitPanel.Visible = true;
            WaitPanel.Dock = DockStyle.None;
            statusLabel.TextAlign = ContentAlignment.MiddleCenter;
            progressBar.Visible = true;
            listView.Visible = false;

            backgroundWorker.RunWorkerAsync(schedule);
        }