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

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

public IFM ( ) : Sfm2Xml.ClsInFieldMarker
Результат Sfm2Xml.ClsInFieldMarker
		public Sfm2Xml.ClsInFieldMarker IFM()
		{
			CheckDisposed();

			string style = cbStyle.Text;
			if (style == NoChange)
				style = "";	// use empty string, not the "<No Change>" text

			string lang = cbLangDesc.Text;
			if (lang == NoChange)
				lang = "";	// use empty string, not the "<No Change>" text

			bool fHaveEndMarker = tbEndMarker.Text.Trim().Length > 0;
			bool fIgnore = lang.Length + style.Length == 0;

			// get the xmlLang value
			string xmlLangValue = "Unknown";
			Sfm2Xml.LanguageInfoUI langUI = m_uiLangs[lang] as Sfm2Xml.LanguageInfoUI;
			if (langUI != null)
				xmlLangValue = langUI.ClsLanguage.XmlLang;

			return new Sfm2Xml.ClsInFieldMarker(tbBeginMarker.Text.Trim(),
				tbEndMarker.Text.Trim(), radioEndWithWord.Checked && !fHaveEndMarker,
				radioEndWithField.Checked && !fHaveEndMarker,
				lang, xmlLangValue, style, fIgnore);
		}

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::IFM