private void changeToolStripMenuItem_Click(object sender, EventArgs e) { CalendarItem item = ReturnCalendarItem(); if (item != null && item.Tag != null) { ScheduledItem schitem = _data.ScheduledItems.Find(x => x.Id == (Guid)item.Tag); using (ConfigureScheduledItems csi = new ConfigureScheduledItems(schitem)) { if (csi.ShowDialog() == DialogResult.OK) { _data.ScheduledItems.Add(csi._scheduledItem); PlaceItems(); } } } else { MessageBox.Show("No item selected to change...", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void addToolStripMenuItem_Click(object sender, EventArgs e) { CalendarItem item = ReturnCalendarItem(); if (item != null && item.Tag != null) { MessageBox.Show("Item already exists.\r\n" + "If you wish to change date/time just drag and drop where you want the item to be.", "Item Exists", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { item = new CalendarItem(calendar1, calendar1.SelectedElementStart.Date, calendar1.SelectedElementEnd.Date, "New Item to Add"); using (ConfigureScheduledItems csi = new ConfigureScheduledItems(item)) { if (csi.ShowDialog() == DialogResult.OK) { _data.ScheduledItems.Add(csi._scheduledItem); PlaceItems(); } } } }
private void changeToolStripMenuItem_Click(object sender, EventArgs e) { CalendarItem item = ReturnCalendarItem(); if (item != null && item.Tag != null) { ScheduledItem schitem = _data.ScheduledItems.Find(x => x.Id == (Guid) item.Tag); using (ConfigureScheduledItems csi = new ConfigureScheduledItems(schitem)) { if (csi.ShowDialog() == DialogResult.OK) { _data.ScheduledItems.Add(csi._scheduledItem); PlaceItems(); } } } else { MessageBox.Show("No item selected to change...", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } }