Exemplo n.º 1
0
 public void Restore(Schedule schedule, DateTime when, string where)
 {
     ExecuteTask(new RestoreTask(schedule, where, when));
 }
Exemplo n.º 2
0
 public string[] ListBackups(Schedule schedule)
 {
     ListBackupsTask task = new ListBackupsTask(schedule);
     ExecuteTask(task);
     return task.Backups;
 }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
        public string[] ListBackups(Schedule schedule)
        {
            ListBackupsTask task = new ListBackupsTask(schedule);
            ExecuteTask(task);

            if (task.IsAborted)
                return null;

            return task.Backups;
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 6
0
 public void FullBackup(Schedule schedule)
 {
     PerformBackup(schedule, true, null);
 }
Exemplo n.º 7
0
 public BackupTask(Schedule schedule)
 {
     m_schedule = schedule;
 }
Exemplo n.º 8
0
 public RemoveOlderThanTask(Schedule schedule, string older)
     : base(schedule)
 {
     m_older = older;
     base.TaskCompleted += new TaskCompletedHandler(DoneEvent);
 }
Exemplo n.º 9
0
 public RestoreTask(Schedule schedule, string targetdir)
     : this(schedule, targetdir, null, new DateTime())
 {
 }
Exemplo n.º 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);
 }
Exemplo n.º 11
0
 public RestoreTask(Schedule schedule, string targetdir, DateTime when)
     : this(schedule, targetdir, null, when)
 {
 }
Exemplo n.º 12
0
 public RestoreTask(Schedule schedule, string targetdir, string sourcefiles)
     : this(schedule, targetdir, sourcefiles, new DateTime())
 {
 }
Exemplo n.º 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();
        }
Exemplo n.º 14
0
 public ListSourceFoldersTask(Schedule schedule, DateTime when)
     : base(schedule, when)
 {
 }
Exemplo n.º 15
0
 public FullBackupTask(Schedule schedule)
     : base(schedule)
 {
 }
Exemplo n.º 16
0
 public RemoveAllButNFullTask(Schedule schedule, int fullcount)
     : base(schedule)
 {
     m_fullCount = fullcount;
     base.TaskCompleted += new TaskCompletedHandler(DoneEvent);
 }
Exemplo n.º 17
0
 protected FullOrIncrementalTask(Schedule schedule)
     : base(schedule)
 {
     base.TaskCompleted += new TaskCompletedHandler(DoneEvent);
 }
Exemplo n.º 18
0
 public RestoreSetupTask(Schedule schedule, string targetdir)
     : base(schedule)
 {
     m_targetdir = targetdir;
 }
Exemplo n.º 19
0
 public IncrementalBackupTask(Schedule schedule, string fullAfter)
     : this(schedule)
 {
     m_fullAfter = fullAfter;
 }
Exemplo n.º 20
0
 public void Setup(Schedule schedule)
 {
     m_schedule = schedule;
     backupItems.Setup(schedule);
 }
Exemplo n.º 21
0
 public IncrementalBackupTask(Schedule schedule)
     : base(schedule)
 {
 }
Exemplo n.º 22
0
 public void IncrementalBackup(Schedule schedule)
 {
     PerformBackup(schedule, false, null);
 }
Exemplo n.º 23
0
 public ListBackupEntriesTask(Schedule schedule)
     : base(schedule)
 {
 }
Exemplo n.º 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;
        }
Exemplo n.º 25
0
 public ListBackupsTask(Schedule schedule)
     : base(schedule)
 {
     this.TaskCompleted += new TaskCompletedHandler(ListBackupsTask_TaskCompleted);
 }
Exemplo n.º 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;
        }
Exemplo n.º 27
0
 public ListFilesTask(Schedule schedule, DateTime when)
     : base(schedule)
 {
     m_when = when;
 }
Exemplo n.º 28
0
 private void PerformBackup(Schedule schedule, bool forceFull, string fullAfter)
 {
     if (forceFull)
         ExecuteTask(new FullBackupTask(schedule));
     else
         ExecuteTask(new IncrementalBackupTask(schedule, fullAfter));
 }
Exemplo n.º 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);
        }