private void MainApplicationForm_Shown(object sender, EventArgs e) { hiLabel.Font = new Font(hiLabel.Font.FontFamily, 20); time1Label.Font = new Font(time1Label.Font.FontFamily, 20); time2Label.Font = new Font(time2Label.Font.FontFamily, 20); wordsCounterLabel1.Font = new Font(wordsCounterLabel1.Font.FontFamily, 20); wordsCounterLabel2.Font = new Font(wordsCounterLabel2.Font.FontFamily, 20); wordsCounterLabel3.Font = new Font(wordsCounterLabel3.Font.FontFamily, 20); mistakeLabel1.Font = new Font(mistakeLabel1.Font.FontFamily, 20); mistakeLabel2.Font = new Font(mistakeLabel2.Font.FontFamily, 20); mistakeLabel3.Font = new Font(mistakeLabel3.Font.FontFamily, 20); label42.Font = new Font(label42.Font.FontFamily, 20); checkIfItIsFirstRun(); initializeLanguageListBox(); ICollection <Word> wordList = wordService.getAll(); foreach (Translation t in translationDBservice.getAll()) { String word1 = wordService.getWordById((int)t.word_id_1); String word2 = wordService.getWordById((int)t.word_id_2); wordsFromDictionary.Items.Add(word1 + " — " + word2); } }
private void filterLanguageComboBox_SelectedIndexChanged(object sender, EventArgs e) { wordsFromDictionary.Items.Clear(); String selectedLanguage = filterLanguageComboBox.SelectedItem.ToString(); if (selectedLanguage.Equals("All")) { foreach (Translation t in translationDBservice.getAll()) { String word1 = wordService.getWordById((int)t.word_id_1); String word2 = wordService.getWordById((int)t.word_id_2); wordsFromDictionary.Items.Add(word1 + " — " + word2); } } else { ICollection <Word> wordCollection = wordService.getWordsByLanguageId(languageService.getIdByTitle(filterLanguageComboBox.SelectedItem.ToString())); foreach (Word w in wordCollection) { wordsFromDictionary.Items.Add(w.word1); } } }