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

btnAdd_Click() protected method

Display the Add Character Mapping Settings dialog box
protected btnAdd_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
		protected void btnAdd_Click(object sender, EventArgs e)
		{
			Debug.Assert(m_projectType != ProjectTypes.Paratext);

			// This creates (if necessary) and then displays the Character Mapping Settings
			// Dialog box.
			m_sMarkerBeingModified = null;
			ImportMappingInfo mapping = new ImportMappingInfo(string.Empty, string.Empty, null);
			DisplayInlineMappingDialog(mapping);

			if (m_inlineMappingDialog.DialogResult == DialogResult.OK)
			{
				// create a new mapping in the in-memory list of the settings
				m_settings.SetMapping(tabCtrlMappings.SelectedIndex == 0 ?
					MappingSet.Main : MappingSet.Notes, mapping);

				// put mapping into the listview
				ListViewItem newListViewItem = LoadLVMappingItem(m_lvCurrentMappingList, mapping);

				//unselect everything
				while (m_lvCurrentMappingList.SelectedItems.Count > 0)
					m_lvCurrentMappingList.SelectedItems[0].Selected = false;

				//select the item just added
				newListViewItem.Selected = true;
				newListViewItem.Focused = true;
			}
			m_lvCurrentMappingList.Focus();
		}