예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }