Ejemplo n.º 1
0
        public void Init(Sfm2Xml.ClsInFieldMarker ifm, Hashtable uiLangsHT, LcmCache 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
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            LexImportWizardLanguage dlg = new LexImportWizardLanguage(m_cache, m_uiLangs);

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                string langDesc, ws, ec, icu;
                // retrieve the new WS information from the dlg
                dlg.GetCurrentLangInfo(out langDesc, out ws, out ec, out icu);

                // now put the lang info into the language list view
                if (LexImportWizard.Wizard().AddLanguage(langDesc, ws, ec, icu))
                {
                    // this was added to the list of languages, so add it to the dlg and select it
                    Sfm2Xml.LanguageInfoUI langInfo = new Sfm2Xml.LanguageInfoUI(langDesc, ws, ec, icu);
                    if (cbLangDesc.FindStringExact(langInfo.ToString()) < 0)
                    {
                        cbLangDesc.Items.Add(langInfo);
                    }
                    cbLangDesc.SelectedItem = langInfo;
                }
            }
        }
		private void btnAdd_Click(object sender, EventArgs e)
		{
			using (var dlg = new LexImportWizardLanguage(m_cache, m_uiLangs, m_helpTopicProvider, m_app, m_stylesheet))
			{
				if (dlg.ShowDialog(this) == DialogResult.OK)
				{
					string langDesc, ws, ec, wsId;
					// retrieve the new WS information from the dlg
					dlg.GetCurrentLangInfo(out langDesc, out ws, out ec, out wsId);

					// now put the lang info into the language list view
					if (LexImportWizard.Wizard().AddLanguage(langDesc, ws, ec, wsId))
					{
						// this was added to the list of languages, so add it to the dlg and select it
						var langInfo = new Sfm2Xml.LanguageInfoUI(langDesc, ws, ec, wsId);
						if (cbLangDesc.FindStringExact(langInfo.ToString()) < 0)
						{
							cbLangDesc.Items.Add(langInfo);
						}
						cbLangDesc.SelectedItem = langInfo;
					}
				}
			}
		}