Inheritance: System.Windows.Forms.Form
Beispiel #1
0
        private bool DoRestore()
        {
            m_restoreSettings.ProjectName = textBoxProjectName.Text;

            if (m_restoreSettings.ProjectExists)
            {
                using (var dlg = new ProjectExistsForm(m_restoreSettings.ProjectName))
                {
                    dlg.StartPosition = FormStartPosition.CenterParent;
                    DialogResult result = dlg.ShowDialog();
                    if (result == DialogResult.Cancel)
                    {
                        textBoxProjectName.SelectAll();
                        textBoxProjectName.Focus();
                        return(false);
                    }
                }
            }

            try
            {
                var restoreService = new ProjectRestoreService(m_restoreSettings, m_ui, null, null);
                restoreService.RestoreProject(new ParatextLexiconPluginThreadedProgress(m_ui.SynchronizeInvoke));

                m_selectedItem = new LanguageProjectInfo(m_restoreSettings.FullProjectPath);
            }
            catch
            {
                MessageBox.Show(Strings.ksRestoreProblemText);
                return(false);
            }

            return(true);
        }
		private bool DoRestore()
		{
			m_restoreSettings.ProjectName = textBoxProjectName.Text;

			if (m_restoreSettings.ProjectExists)
			{
				using (var dlg = new ProjectExistsForm(m_restoreSettings.ProjectName))
				{
					dlg.StartPosition = FormStartPosition.CenterParent;
					DialogResult result = dlg.ShowDialog();
					if (result == DialogResult.Cancel)
					{
						textBoxProjectName.SelectAll();
						textBoxProjectName.Focus();
						return false;
					}
				}
			}

			try
			{
				var restoreService = new ProjectRestoreService(m_restoreSettings, m_ui, null, null);
				restoreService.RestoreProject(new ParatextLexiconPluginThreadedProgress(m_ui.SynchronizeInvoke));

				m_selectedItem = new LanguageProjectInfo(m_restoreSettings.FullProjectPath);
			}
			catch
			{
				MessageBox.Show(Strings.ksRestoreProblemText);
				return false;
			}

			return true;
		}