private static WritingSystemDefinition ShowCreateNewWritingSystemDialog() { using (var dlg = new LookupISOCodeDialog() { ShowDesiredLanguageNameField = false }) { dlg.ShowDialog(); if (dlg.DialogResult != DialogResult.OK) { return(null); } var variant = String.Empty; if (dlg.SelectedLanguage.Code == WellKnownSubTags.Unlisted.Language) { variant = "x-" + "Unlisted"; } return(new WritingSystemDefinition(dlg.SelectedLanguage.Code, string.Empty, string.Empty, variant, dlg.SelectedLanguage.Code, false)); } }
private void OnLookupISOCodeDialogClicked(object sender, EventArgs e) { using (var dialog = new LookupISOCodeDialog()) dialog.ShowDialog(); }
private LanguageInfo ChangeLanguage(string iso639Code, string potentiallyCustomName=null) { using (var dlg = new LookupISOCodeDialog()) { //at this point, we don't let them customize the national languages dlg.ShowDesiredLanguageNameField = potentiallyCustomName != null; dlg.SelectedLanguage = new LanguageInfo() { Code = iso639Code}; if(!string.IsNullOrEmpty(potentiallyCustomName)) { dlg.SelectedLanguage.DesiredName = potentiallyCustomName; } if (DialogResult.OK != dlg.ShowDialog()) { return null; } return dlg.SelectedLanguage; } }