private void _editButton_Click(object sender, EventArgs e) { EventDataWrapper eventData = _activeListbox.SelectedItem as EventDataWrapper; if (eventData == null) { eventData = _inactiveListbox.SelectedItem as EventDataWrapper; } if (eventData != null) { using (EventInstanceEditor instanceEditor = new EventInstanceEditor(eventData)) { instanceEditor.ShowInTaskbar = false; instanceEditor.MaximizeBox = false; instanceEditor.MinimizeBox = false; instanceEditor.StartPosition = FormStartPosition.CenterParent; instanceEditor.ShowDialog(this); EventManager.SaveManager(); } } }
private void _newButton_Click(object sender, EventArgs e) { EventDataWrapper eventData = new EventDataWrapper(EventDefinitionManager.EventDefinition); using (EventInstanceEditor instanceEditor = new EventInstanceEditor(eventData)) { instanceEditor.ShowInTaskbar = false; instanceEditor.MaximizeBox = false; instanceEditor.MinimizeBox = false; instanceEditor.StartPosition = FormStartPosition.CenterParent; if (instanceEditor.ShowDialog(this) != DialogResult.OK) { return; } EventDataWrapper instance = instanceEditor.Event; instance.Active = true; EventManager.EventDatabase.EventDataWrappers.Add(instance); _activeListbox.Items.Add(instance); EventManager.SaveManager(); } }