Back to Devexpress

Recurrence - Exceptions (examples)

windowsforms-6209-controls-and-libraries-scheduler-examples-recurrence-recurrence-exceptions-examples.md

latest1.4 KB
Original Source

Recurrence - Exceptions (examples)

  • Oct 29, 2020

An appointment occurs every hour for 24 hours. There are no appointments at 7 AM, 1 PM and 6 PM. An appointment at 3 PM starts 15 minutes later than normal.

csharp
apt.RecurrenceInfo.Type = RecurrenceType.Hourly;
apt.RecurrenceInfo.Start = apt.Start;
apt.RecurrenceInfo.Periodicity = 1;
apt.RecurrenceInfo.Range = RecurrenceRange.EndByDate;
apt.RecurrenceInfo.End = apt.RecurrenceInfo.Start.AddHours(24);
apt.CreateException(AppointmentType.DeletedOccurrence, 7);
apt.CreateException(AppointmentType.DeletedOccurrence, 13);
apt.CreateException(AppointmentType.DeletedOccurrence, 18);
apt.GetOccurrence(15).Start = apt.GetOccurrence(15).Start.AddMinutes(15);
vb
apt.RecurrenceInfo.Type = RecurrenceType.Hourly
apt.RecurrenceInfo.Start = apt.Start
apt.RecurrenceInfo.Periodicity = 1
apt.RecurrenceInfo.Range = RecurrenceRange.EndByDate
apt.RecurrenceInfo.End = apt.RecurrenceInfo.Start.AddHours(24)
apt.CreateException(AppointmentType.DeletedOccurrence, 7)
apt.CreateException(AppointmentType.DeletedOccurrence, 13)
apt.CreateException(AppointmentType.DeletedOccurrence, 18)
apt.GetOccurrence(15).Start = apt.GetOccurrence(15).Start.AddMinutes(15)

See Also

Appointments

RecurrenceInfo