private WritingSystemDefinition ShowCreateNewWritingSystemDialog() { using (var dlg = new LanguageLookupDialog { IsDesiredLanguageNameFieldVisible = false, IsShowRegionalDialectsCheckBoxVisible = false }) { WaitCursor.Show(); try { dlg.LoadLanguages(); } finally { WaitCursor.Hide(); } dlg.ShowDialog(); if (dlg.DialogResult != DialogResult.OK) { return(null); } return(_model.WritingSystemFactory.CreateAndWarnUserIfOutOfDate(dlg.SelectedLanguage.LanguageTag)); } }
private LanguageInfo ChangeLanguage(string iso639Code, string potentiallyCustomName=null) { using (var dlg = new LanguageLookupDialog()) { //at this point, we don't let them customize the national languages dlg.IsDesiredLanguageNameFieldVisible = potentiallyCustomName != null; var language = new LanguageInfo() { LanguageTag = iso639Code}; if (!string.IsNullOrEmpty(potentiallyCustomName)) { language.DesiredName = potentiallyCustomName; // to be noticed, must set before dlg.SelectedLanguage } dlg.SelectedLanguage = language; dlg.SearchText = iso639Code; if (DialogResult.OK != dlg.ShowDialog()) { return null; } return dlg.SelectedLanguage; } }
private WritingSystemDefinition ShowCreateNewWritingSystemDialog() { using (var dlg = new LanguageLookupDialog {IsDesiredLanguageNameFieldVisible = false, IsShowRegionalDialectsCheckBoxVisible = false}) { WaitCursor.Show(); try { dlg.LoadLanguages(); } finally { WaitCursor.Hide(); } dlg.ShowDialog(); if (dlg.DialogResult != DialogResult.OK) return null; return _model.WritingSystemFactory.CreateAndWarnUserIfOutOfDate(dlg.SelectedLanguage.LanguageTag); } }
private void OnLanguageLookupDialogClicked(object sender, EventArgs e) { using (var dialog = new LanguageLookupDialog()) dialog.ShowDialog(); }