private void btnCreateAction_Click(object sender, EventArgs e) { EditActionForm editActionForm = new EditActionForm(); if (editActionForm.ShowDialog() == DialogResult.OK) { EventAction eventAction = editActionForm.GetAction(); listBoxActions.Items.Add(eventAction); } }
private void btnEditAction_Click(object sender, EventArgs e) { if (listBoxActions.SelectedItem == null) { return; } EditActionForm editActionForm = new EditActionForm(); editActionForm.SetAction((EventAction)listBoxActions.SelectedItem); if (editActionForm.ShowDialog() == DialogResult.OK) { listBoxActions.Items.Remove(listBoxActions.SelectedItem); EventAction eventAction = editActionForm.GetAction(); listBoxActions.Items.Add(eventAction); } }