SIL.FieldWorks.TE.ImportWizard.ValidToGoForward C# (CSharp) Method

ValidToGoForward() private method

private ValidToGoForward ( ) : bool
return bool
		private bool ValidToGoForward()
		{
			if (m_settings == null)
				throw new InvalidOperationException("ScrImportSet object must be set.");

			using (new WaitCursor(this))
			{
				switch (m_currentStep)
				{
					case (int)WizSteps.ProjType:
						// Makes sure things are in order after the user selects what type
						// of project he wants to import.
						if (rbParatext6.Checked)
						{
							if (m_projectType != ProjectTypes.Paratext && !PrepareToGetParatextProjectSettings())
								return false;
							Logger.WriteEvent("Import Wizard: Paratext Project");
						}
						else if (rbOther.Checked)
						{
							if (m_projectType != ProjectTypes.Other)
								PrepareToGetOtherProjectSettings();

							Logger.WriteEvent("Import Wizard: Other Standard Format");
						}
						else
							Logger.WriteEvent("Import Wizard: Paratext data files");

						break;

					case (int)WizSteps.ProjLocation:
						if (!rbParatext6.Checked)
							return sfFileListBuilder.Valid();

						if (cboPTLangProj.SelectedIndex < 0)
							return false;
						try
						{
							return SetParatextProjectIds();
						}
						catch (Exception e)
						{
							if (e is ArgumentException || e is ParatextLoadException)
							{
								Logger.WriteError(e);
								MessageBox.Show(this, e.Message, m_app.ApplicationName,
									MessageBoxButtons.OK, MessageBoxIcon.Information);
								return false;
							}
							throw;
						}

					case (int)WizSteps.Mapping:
						try
						{
							return m_settings.Valid;
						}
						catch (ScriptureUtilsException e)
						{
							// TODO-Linux: Help is not implemented in Mono
							MessageBox.Show(this, e.Message, ScriptureUtilsException.GetResourceString("kstidImportErrorCaption"),
								MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 0, m_helpTopicProvider.HelpFile,
								HelpNavigator.Topic, e.HelpTopic);
							return false;
						}
				}
			}
			return true;
		}