Пример #1
0
 /// <summary>
 /// Gets a source folder setup, based on the users filter selection
 /// </summary>
 /// <param name="task">The Task instance with the user setup</param>
 /// <param name="filters">The filter settings</param>
 /// <returns>The source folder string</returns>
 public static string[] GetSourceFolders(Task task, ApplicationSettings settings, List<KeyValuePair<bool, string>> filters)
 {
     if (task.Extensions.SelectFiles_Version >= 2 && task.Extensions.SelectFiles_UseSimpleMode)
     {
         return GetSourceFolders(
             task.Extensions.SelectFiles_IncludeDocuments,
             task.Extensions.SelectFiles_IncludeMusic,
             task.Extensions.SelectFiles_IncludeImages,
             task.Extensions.SelectFiles_IncludeDesktop,
             task.Extensions.SelectFiles_IncludeAppData,
             settings,
             filters);
     }
     else
     {
         return PrependFilterList(task.SourcePath.Split(System.IO.Path.PathSeparator), settings, filters);
     }
 }
Пример #2
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;
            }
        }
Пример #3
0
 public TaskExtensionWrapper(Task owner)
 {
     m_owner = owner;
 }