public GetTesseractDictionaries() { UiUtil.PreInitialize(this); InitializeComponent(); UiUtil.FixFonts(this); Text = Configuration.Settings.Language.GetTesseractDictionaries.Title; labelDescription1.Text = Configuration.Settings.Language.GetTesseractDictionaries.DescriptionLine1; linkLabelOpenDictionaryFolder.Text = Configuration.Settings.Language.GetTesseractDictionaries.OpenDictionariesFolder; labelChooseLanguageAndClickDownload.Text = Configuration.Settings.Language.GetTesseractDictionaries.ChooseLanguageAndClickDownload; buttonDownload.Text = Configuration.Settings.Language.GetTesseractDictionaries.Download; labelPleaseWait.Text = string.Empty; buttonOK.Text = Configuration.Settings.Language.General.Ok; FixLargeFonts(); _dictionaries = TesseractDictionary.List(); LoadDictionaryList(); }
private void LoadDictionaryList(bool first) { comboBoxDictionaries.BeginUpdate(); comboBoxDictionaries.Items.Clear(); for (int i = 0; i < _dictionaries.Count; i++) { TesseractDictionary d = _dictionaries[i]; if (!string.IsNullOrEmpty(d.Url)) { comboBoxDictionaries.Items.Add(d); if (first && d.Name == "English") { comboBoxDictionaries.SelectedIndex = i; } } } if (comboBoxDictionaries.SelectedIndex < 0) { comboBoxDictionaries.SelectedIndex = 0; } comboBoxDictionaries.EndUpdate(); comboBoxDictionaries.AutoCompleteSource = AutoCompleteSource.ListItems; comboBoxDictionaries.AutoCompleteMode = AutoCompleteMode.Append; }