Exemplo n.º 1
0
        private void btnAddEvent_Click(object sender, EventArgs e)
        {
            var eventEditor = new frmEventEditor();

            eventEditor.Text = "Add Event";
            eventEditor.ShowDialog();
        }
Exemplo n.º 2
0
        private void btnEditEvent_Click(object sender, EventArgs e)
        {
            var items = lviewUpcomingEvents.SelectedItems;
            var count = lviewUpcomingEvents.SelectedItems.Count;

            if (count == 1)
            {
                var eventEditor = new frmEventEditor((ScheduledEvent)items[0].Tag);
                eventEditor.Text = "Edit Event";
                eventEditor.ShowDialog();
            }
            else if (count > 1)
            {
                MessageBox.Show("You can only delete one event at a time.", "Edit Event", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                MessageBox.Show("You must select an event to edit.", "Edit Event", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }