public void LoadDictionary() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = dictionaryFileTypes; openFileDialog.FilterIndex = 0; openFileDialog.Multiselect = false; openFileDialog.CheckFileExists = true; DialogResult result = openFileDialog.ShowDialog(); if (result == DialogResult.OK) { String path = openFileDialog.FileName; Excel.Application ExcelApplication = new Excel.Application(); try { theWorkbook = ExcelApplication.Workbooks.Open(path, 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true); } catch (Exception e) { return; } if (theWorkbook._CodeName.Equals("MEUSDictionary")) { } else { dict = new DictionaryData(ExcelApplication); LoadTranslatePane(); myTip.Visible = true; } } }
public TranslationPane(DictionaryData data) { InitializeComponent(); if (data != null) { dictionaryData = data; Group_ComboBox.Items.AddRange(dictionaryData.Groups.ToArray()); WordList.Items.AddRange(dictionaryData.GetWordList()); } }
private void cbWord_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cb = sender as ComboBox; if (cb.DataSource == null) { return; } DictionaryData data = cb.SelectedItem as DictionaryData; txbMeaning.Text = data.Meaning; }
private void comboBoxWord_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cb = sender as ComboBox; if (cb.DataSource == null) { return; } DictionaryData dictionaryData = cb.SelectedItem as DictionaryData; textBoxMeaning.Text = dictionaryData.Meaning; textBoxExplanation.Text = dictionaryData.Explaination; }
private void cbWord_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cb = (ComboBox)sender; if (cb.DataSource == null) { return; } DictionaryData data = (DictionaryData)cb.SelectedItem; txtBoxMeaning.Text = data.Meaning; txtBoxExplain.Text = data.Explaination; }