private void Edit_Click(object sender, EventArgs e) { if (lw_kanji.SelectedItems != null && lw_kanji.SelectedItems.Count > 0) { frm_addeditcard addeditCardForm = new frm_addeditcard(); addeditCardForm.MainWindowRef = this; addeditCardForm.SetCurrentMode(frm_addeditcard.CardManagementMode.Edit, SharedResources.CurrentDeck.Cards[(Int32)lw_kanji.SelectedItems[0].Tag]); addeditCardForm.ShowDialog(); } }
private void btn_add_card_Click(object sender, EventArgs e) { if (SharedResources.CurrentDeck != null) { frm_addeditcard addeditCardForm = new frm_addeditcard(); addeditCardForm.MainWindowRef = this; addeditCardForm.SetCurrentMode(frm_addeditcard.CardManagementMode.Add, null); addeditCardForm.ShowDialog(); } else { MessageBox.Show("There is currently no deck loaded. You must load a deck before adding a card.", "Error"); } }