SIL.FieldWorks.LexText.Controls.LexImportWizardCharMarkerDlg.Init C# (CSharp) Метод

Init() публичный Метод

public Init ( Sfm2Xml ifm, Hashtable uiLangsHT, SIL.FieldWorks.FDO.FdoCache cache ) : void
ifm Sfm2Xml
uiLangsHT System.Collections.Hashtable
cache SIL.FieldWorks.FDO.FdoCache
Результат void
		public void Init(Sfm2Xml.ClsInFieldMarker ifm, Hashtable uiLangsHT, FdoCache cache)
		{
			CheckDisposed();

			if (ifm == null)
				ifm = new Sfm2Xml.ClsInFieldMarker();

			m_inlineMarker = ifm;
			m_uiLangs = uiLangsHT;
			m_cache = cache;

			// ====================================================================
			// Set the language descriptor combo box.  This is a DropList so that
			// the entered text can't be different from the contents of the list.
			// If the user wants a new language descriptor they have to add one.

			cbLangDesc.Items.Add(NoChange);
			cbLangDesc.SelectedItem = NoChange;

			foreach (DictionaryEntry lang in m_uiLangs)
			{
				Sfm2Xml.LanguageInfoUI langInfo = lang.Value as Sfm2Xml.LanguageInfoUI;
				// make sure there is only one entry for each writing system (especially 'ignore')
				if (cbLangDesc.FindStringExact(langInfo.ToString()) < 0)
				{
					cbLangDesc.Items.Add(langInfo);
					if (langInfo.FwName == m_inlineMarker.Language)
						cbLangDesc.SelectedItem = langInfo;
				}
			}

			InitializeStylesComboBox();

			HideOKBtn();	// see if it needs to be visible or not
		}

Usage Example

Пример #1
0
		private void btnModifyCharMapping_Click(object sender, System.EventArgs e)
		{
			ListView.SelectedIndexCollection selIndexes = listViewCharMappings.SelectedIndices;
			if (selIndexes.Count < 1 || selIndexes.Count > 1)
				return;	// only handle single selection at this time

			int selIndex = selIndexes[0];	// only support 1
			Sfm2Xml.ClsInFieldMarker selectedIFM;
			selectedIFM = listViewCharMappings.Items[selIndex].Tag as Sfm2Xml.ClsInFieldMarker;
			using (var dlg = new LexImportWizardCharMarkerDlg(m_mediator.HelpTopicProvider, m_app, m_stylesheet))
			{
			dlg.Init(selectedIFM, GetUILanguages(), m_cache);
			dlg.SetExistingBeginMarkers(ExtractExistingBeginMarkers(true));
			dlg.SetExistingEndMarkers(ExtractExistingEndMarkers(true));
			dlg.SetExistingElementNames(ExtractExistingElementNames(true));
			if (dlg.ShowDialog(this) == DialogResult.OK)
			{
				m_dirtySenseLastSave = true;
				// remove the old from the treeview display
				listViewCharMappings.Items[selIndex].Selected = false;
				listViewCharMappings.Items[selIndex].Focused = false;
				listViewCharMappings.Items.RemoveAt(selIndex);

				// now update the item and add it again and then select it
				AddInLineMarker(dlg.IFM(), true);
				listViewCharMappings.Focus();
			}
		}
		}
All Usage Examples Of SIL.FieldWorks.LexText.Controls.LexImportWizardCharMarkerDlg::Init