Example #1
0
        private void btnCreateObject_Click(object sender, EventArgs e)
        {
            EventObject         eventObject;
            EditEventObjectForm editEventObject = new EditEventObjectForm();

            if (editEventObject.ShowDialog() == DialogResult.OK)
            {
                eventObject = editEventObject.GetEventObject();
                listBoxObjects.Items.Add(eventObject);
            }
        }
Example #2
0
        private void btnEditObject_Click(object sender, EventArgs e)
        {
            if (listBoxObjects.SelectedItem != null)
            {
                EditEventObjectForm editEventObject = new EditEventObjectForm();
                if (listBoxObjects.SelectedItem != null)
                {
                    editEventObject.SetEventObject((EventObject)listBoxObjects.SelectedItem);
                }

                if (editEventObject.ShowDialog() == DialogResult.OK)
                {
                    EventObject eventObject = editEventObject.GetEventObject();
                    listBoxObjects.Items[listBoxObjects.SelectedIndex] = eventObject;
                }
            }
        }