Exemplo n.º 1
0
        internal bool IsOkayToRestoreProject()
        {
            // If the project doesn't exist, it's ok to create it
            if (!m_restoreProjectView.Settings.ProjectExists)
            {
                return(true);
            }

            // If the user is using Send/Receive, it is NOT OK to restore
            if (m_restoreProjectView.Settings.UsingSendReceive)
            {
                MessageBox.Show(FwCoreDlgs.ksBackupCantRestoreWhenUsingSRMsg, FwCoreDlgs.ksBackupCantRestoreWhenUsingSRCaption,
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            using (var dlg = new OverwriteExistingProject(m_restoreProjectView.Settings.ProjectName,
                                                          m_restoreProjectView.HelpTopicProvider))
            {
                var result = dlg.ShowDialog();
                if (result != DialogResult.Yes)
                {
                    return(false);
                }
                m_restoreProjectView.Settings.BackupOfExistingProjectRequested = dlg.BackupBeforeOverwritting;
            }

            return(true);
        }
        internal bool IsOkayToRestoreProject()
        {
            if (m_restoreProjectView.Settings.ProjectExists)
            {
                using (var dlg = new OverwriteExistingProject(m_restoreProjectView.Settings.ProjectName,
                                                              m_restoreProjectView.HelpTopicProvider))
                {
                    var result = dlg.ShowDialog();
                    if (result == DialogResult.No || result == DialogResult.Cancel)
                    {
                        return(false);
                    }
                    m_restoreProjectView.Settings.BackupOfExistingProjectRequested = dlg.BackupBeforeOverwritting;
                }
            }

            return(true);
        }
Exemplo n.º 3
0
		internal bool IsOkayToRestoreProject()
		{
			// If the project doesn't exist, it's ok to create it
			if (!m_restoreProjectView.Settings.ProjectExists)
				return true;

			// If the user is using Send/Receive, it is NOT OK to restore
			if (m_restoreProjectView.Settings.UsingSendReceive)
			{
				MessageBox.Show(FwCoreDlgs.ksBackupCantRestoreWhenUsingSRMsg, FwCoreDlgs.ksBackupCantRestoreWhenUsingSRCaption,
					MessageBoxButtons.OK, MessageBoxIcon.Error);
				return false;
			}

			using (var dlg = new OverwriteExistingProject(m_restoreProjectView.Settings.ProjectName,
				m_restoreProjectView.HelpTopicProvider))
			{
				var result = dlg.ShowDialog();
				if (result != DialogResult.Yes)
					return false;
				m_restoreProjectView.Settings.BackupOfExistingProjectRequested = dlg.BackupBeforeOverwritting;
			}

			return true;
		}