private void NewSingleEntry() { using (SingleAppointmentForm newAppointmentForm = new SingleAppointmentForm(monthCalendar.SelectionRange.Start)) { if (newAppointmentForm.ShowDialog() == DialogResult.OK) { // Add the entry that was created in the dialog, refresh the entries on selected date list. // Save all entries. // Invaidate the daily view in case the entry that was added was for the day being viewed. _calendarEntries.Add(newAppointmentForm.Entry); RefreshDailyView(); } } }
private void editEntry(ICalendarEntry entry) { if (entry.GetType() == typeof(RecurringCalendarEntry)) { using (RecurringAppointmentForm newAppointmentForm = new RecurringAppointmentForm((RecurringCalendarEntry)entry)) { if (newAppointmentForm.ShowDialog() == DialogResult.OK) { RefreshDailyView(); } } } else if (entry.GetType() == typeof(SingleCalendarEntry)) { using (SingleAppointmentForm newAppointmentForm = new SingleAppointmentForm((SingleCalendarEntry)entry)) { if (newAppointmentForm.ShowDialog() == DialogResult.OK) { RefreshDailyView(); } } } }