private void m_backUp_Click(object sender, EventArgs e) { if (!Path.IsPathRooted(DestinationFolder)) { MessageBox.Show(this, FwCoreDlgs.ksBackupErrorRelativePath, FwCoreDlgs.ksErrorCreatingBackupDirCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); m_destinationFolder.Select(); DialogResult = DialogResult.None; return; } if (!Directory.Exists(DestinationFolder)) { try { Directory.CreateDirectory(DestinationFolder); } catch (Exception e1) { MessageBox.Show(this, e1.Message, FwCoreDlgs.ksErrorCreatingBackupDirCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); m_destinationFolder.Select(); DialogResult = DialogResult.None; return; } } if (!DestinationFolder.Equals(FwDirectoryFinder.DefaultBackupDirectory)) { using (var dlgChangeDefaultBackupLocation = new ChangeDefaultBackupDir(m_helpTopicProvider)) { if (dlgChangeDefaultBackupLocation.ShowDialog(this) == DialogResult.Yes) { FwDirectoryFinder.DefaultBackupDirectory = DestinationFolder; } } } if (m_presenter.FileNameProblems(this)) { return; } try { using (new WaitCursor(this)) using (var progressDlg = new ProgressDialogWithTask(this)) { BackupFilePath = m_presenter.BackupProject(progressDlg); } } catch (FwBackupException be) { MessageBox.Show(this, string.Format(FwCoreDlgs.ksBackupErrorCreatingZipfile, be.ProjectName, be.Message), FwCoreDlgs.ksBackupErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); DialogResult = DialogResult.None; } }
private void m_backUp_Click(object sender, EventArgs e) { if (!Path.IsPathRooted(DestinationFolder)) { MessageBox.Show(this, FwCoreDlgs.ksBackupErrorRelativePath, FwCoreDlgs.ksErrorCreatingBackupDirCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); m_destinationFolder.Select(); DialogResult = DialogResult.None; return; } if (!Directory.Exists(DestinationFolder)) { try { Directory.CreateDirectory(DestinationFolder); } catch (Exception e1) { MessageBox.Show(this, e1.Message, FwCoreDlgs.ksErrorCreatingBackupDirCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); m_destinationFolder.Select(); DialogResult = DialogResult.None; return; } } if (!DestinationFolder.Equals(FwDirectoryFinder.DefaultBackupDirectory)) { using (var dlgChangeDefaultBackupLocation = new ChangeDefaultBackupDir(m_helpTopicProvider)) { if (dlgChangeDefaultBackupLocation.ShowDialog(this) == DialogResult.Yes) FwDirectoryFinder.DefaultBackupDirectory = DestinationFolder; } } if (m_presenter.FileNameProblems(this)) return; try { using (new WaitCursor(this)) using (var progressDlg = new ProgressDialogWithTask(this)) { BackupFilePath = m_presenter.BackupProject(progressDlg); } } catch (FwBackupException be) { MessageBox.Show(this, string.Format(FwCoreDlgs.ksBackupErrorCreatingZipfile, be.ProjectName, be.Message), FwCoreDlgs.ksBackupErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); DialogResult = DialogResult.None; } }