private void miAddEvent_Click(object sender, EventArgs e) { EventDialog ed = new EventDialog(this); ed.ShowDialog(); if (ed.DialogResult == DialogResult.OK) { events.Add(ed.Event); GenericSerializer.SerializeXML <List <EventData> >("Events.xml", events); } }
private void miEditEvent_Click(object sender, EventArgs e) { EventData temp = events[index]; EventDialog ed = new EventDialog(this, temp); ed.ShowDialog(); if (ed.DialogResult == DialogResult.OK) { events.Add(ed.Event); events.Remove(temp); ed.Dispose(); ed = null; tmrCycle.Enabled = false; if (++index > events.Count - 1) { index = 0; } tmrCycle.Enabled = prefs.Cycle.Enabled; GenericSerializer.SerializeXML <List <EventData> >("Events.xml", events); } }