Example #1
0
        private void btn_Restore_Click(object sender, EventArgs e)
        {
            BackupSourceSelectionDialogForm quizForm = new BackupSourceSelectionDialogForm();

            quizForm.ShowDialog();
            BackupSourceSelectionDialogForm.BackupSourceDialogResultType quizResult = quizForm.Result;
            quizForm.Dispose();

            if (quizResult == BackupSourceSelectionDialogForm.BackupSourceDialogResultType.AllAvailable)
            {
                MatchingBackupLocationListForm locationForm = new MatchingBackupLocationListForm(_backupMgr);
                DialogResult locationDialogResult           = locationForm.ShowDialog();
                int?         locationResultID = locationForm.SelectedLocationID;
                locationForm.Dispose();
                if (locationDialogResult == DialogResult.OK)
                {
                    if (locationResultID != null)
                    {
                        this.Visible = false;
                        RestoreForm restoreForm = new RestoreForm(_backupMgr.GetRestoreManager(locationResultID.Value), generalResourceManager);
                        restoreForm.ShowDialog();
                        restoreForm.Dispose();
                        this.Close();
                    }
                }
            }
            else if (quizForm.Result == BackupSourceSelectionDialogForm.BackupSourceDialogResultType.ThisKeyOnly)
            {
                this.Visible = false;
                RestoreForm restoreForm = new RestoreForm(_backupMgr.GetRestoreManager(), generalResourceManager);
                restoreForm.ShowDialog();
                restoreForm.Dispose();
                this.Close();
            }
            else
            {
                //user cancelled, do nothing
            }
        }
Example #2
0
        private void btn_Restore_Click(object sender, EventArgs e)
        {
            BackupSourceSelectionDialogForm quizForm = new BackupSourceSelectionDialogForm();
            quizForm.ShowDialog();
            BackupSourceSelectionDialogForm.BackupSourceDialogResultType quizResult = quizForm.Result;
            quizForm.Dispose();

            if (quizResult == BackupSourceSelectionDialogForm.BackupSourceDialogResultType.AllAvailable)
            {
                MatchingBackupLocationListForm locationForm = new MatchingBackupLocationListForm(_backupMgr);
                DialogResult locationDialogResult = locationForm.ShowDialog();
                int? locationResultID = locationForm.SelectedLocationID;
                locationForm.Dispose();
                if (locationDialogResult == DialogResult.OK)
                {
                    if (locationResultID != null)
                    {
                        this.Visible = false;
                        RestoreForm restoreForm = new RestoreForm(_backupMgr.GetRestoreManager(locationResultID.Value), generalResourceManager);
                        restoreForm.ShowDialog();
                        restoreForm.Dispose();
                        this.Close();
                    }
                }
            }
            else if (quizForm.Result == BackupSourceSelectionDialogForm.BackupSourceDialogResultType.ThisKeyOnly)
            {
                this.Visible = false;
                RestoreForm restoreForm = new RestoreForm(_backupMgr.GetRestoreManager(), generalResourceManager);
                restoreForm.ShowDialog();
                restoreForm.Dispose();
                this.Close();
            }
            else
            {
                //user cancelled, do nothing
            }
        }