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

LoadParatextProjectCombo() private method

Load the given combobox and select the selected project, if any.
private LoadParatextProjectCombo ( SIL.FieldWorks.Common.Controls.FwOverrideComboBox cbo, string selectedProj ) : void
cbo SIL.FieldWorks.Common.Controls.FwOverrideComboBox The combo box to load
selectedProj string The short name of the project to select
return void
		private void LoadParatextProjectCombo(FwOverrideComboBox cbo, string selectedProj)
		{
			// Initialize the combobox with a sorted list of language projects:
			//   language name (project short name)
			cbo.Items.AddRange(m_PTLangProjects.ToArray());

			// Select the appropriate project in the list.
			if (!string.IsNullOrEmpty(selectedProj))
			{
				for (int i = 0; i < cbo.Items.Count; i++)
				{
					if (selectedProj == ((ScrText)cbo.Items[i]).Name)
						cbo.SelectedIndex = i;
				}
			}

			// If no project is set, select the first one.
			if (cbo.SelectedIndex < 0 && cbo.Items.Count > 0)
				cbo.SelectedIndex = 0;
		}
		#endregion