Beispiel #1
0
        void FinishedRestore_PageLeave(object sender, PageChangedArgs args)
        {
            if (args.Direction == PageChangedDirection.Back)
            {
                return;
            }

            if (!RunInBackground.Checked)
            {
                try
                {
                    m_waitdlg = new Duplicati.GUI.HelperControls.WaitForOperation();
                    m_waitdlg.Setup(new DoWorkEventHandler(Restore), Strings.FinishedRestore.RestoreWaitDialogTitle, true);
                    if (m_waitdlg.ShowDialog() != DialogResult.OK)
                    {
                        if (m_waitdlg.Error != null)
                        {
                            throw m_waitdlg.Error;
                        }

                        args.Cancel = true;
                        return;
                    }

                    m_owner.CancelButton.PerformClick();
                    m_waitdlg = null;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, string.Format(Strings.FinishedRestore.RestoreFailedError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                args.Cancel = true;
                return;
            }
        }
        void FinishedRestore_PageLeave(object sender, PageChangedArgs args)
        {
            if (args.Direction == PageChangedDirection.Back)
                return;

            if (!RunInBackground.Checked)
            {
                try
                {
                    m_waitdlg = new XervBackup.GUI.HelperControls.WaitForOperation();
                    m_waitdlg.Setup(new DoWorkEventHandler(Restore), Strings.FinishedRestore.RestoreWaitDialogTitle, true);
                    if (m_waitdlg.ShowDialog() != DialogResult.OK)
                    {
                        if (m_waitdlg.Error != null)
                            throw m_waitdlg.Error;

                        args.Cancel = true;
                        return;
                    }

                    m_owner.CancelButton.PerformClick();
                    m_waitdlg = null;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, string.Format(Strings.FinishedRestore.RestoreFailedError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                args.Cancel = true;
                return;
            }
        }