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

CheckProjectCombo() private method

Checks the contents of the project combo. We call this after we attempt to assign the projName in the import settings to the current selection in the project combo box.
private CheckProjectCombo ( string projName, SIL.FieldWorks.Common.Controls.FwOverrideComboBox projCombo, ImportDomain domain ) : void
projName string Name of the project in the import settings.
projCombo SIL.FieldWorks.Common.Controls.FwOverrideComboBox The project combo.
domain ImportDomain The import domain.
return void
		private void CheckProjectCombo(string projName, FwOverrideComboBox projCombo,
			ImportDomain domain)
		{
			string ptShortName = GetPTShortName(projCombo);

			// if the project name was set successfully to the contents of the short name from the combobox.
			if (projName != null && projName.Equals(ptShortName))
			{
				// no problems with the selected item. We're finished.
				return;
			}

			// If the project name is null but the selected project is "none" then the selected
			// item is fine. The selected project is "none" when the domain in back translation
			// or notes and the selected index in the combobox is 0.
			if ((domain == ImportDomain.BackTrans || domain == ImportDomain.Annotations) &&
				projCombo.SelectedIndex == 0)
			{
				return;
			}

			// However, if the project name is null and the selected item in the combo box
			// is something else, then we need to throw an exception so that the user will
			// be notified about a problem with the project that they selected.
			throw new ParatextLoadException(string.Format(TeResourceHelper.GetResourceString(
				"kstidParatextProjectLoadFailure"), ptShortName), null);
		}