/// <summary> /// Adds a new vocabulary /// </summary> private void button3_Click(object sender, EventArgs e) { AddVocabulary form = new AddVocabulary(); if (form.ShowDialog() == DialogResult.OK) { Data.vocabulary.Add(form.vocabulary); } UpdateVocabulary(); }
/// <summary> /// Edits the selected vocabulary /// </summary> private void button_voc_edit_Click(object sender, EventArgs e) { Vocabulary vocab = getSelectedVocabulary(); if (vocab != null) { AddVocabulary form = new AddVocabulary(vocab); if (form.ShowDialog() == DialogResult.OK) { Data.vocabulary.Remove(vocab); Data.vocabulary.Add(form.vocabulary); } UpdateVocabulary(); } }