expressappframework-113128-event-planning-and-notifications-scheduler-recurring-events.md
This topic introduces the concept of the Recurring Events feature supported by the Scheduler Module, describes how to create and use recurring events in your schedule, and details how recurrence settings can be edited.
The Scheduler module supports the following event types:
SimpleOccur only once in the specified time interval.RecurringOccur many times with the same time interval.
The Scheduler module works with business classes that implement the DevExpress.Persistent.Base.General.IEvent interface. To support recurring events, these classes must implement an additional IRecurrentEvent interface. If you already have a custom class that implements the IEvent interface, you can implement the IRecurrentEvent interface yourself. Alternatively, you can use the DevExpress.Persistent.BaseImpl.EF.Event (Entity Framework Core) or DevExpress.Persistent.BaseImpl.Event (XPO) class from the Business Class Library that implements the IEvent and IRecurrentEvent interfaces.
To see how these classes are implemented, refer to the following resources:
To extend the class with custom properties, inherit from it.
To create a recurring event, create an Event and specify its recurrence via the Recurrence property. XAF uses SchedulerRecurrenceInfoPropertyEditor to display this property in the Event Detail View.
ASP.NET Core Blazor Windows Forms
Click the Recurrence editor’s ellipsis button (Windows Forms) or select a combo box value (ASP.NET Core Blazor) to invoke the Recurrence dialog and specify the required settings.
ASP.NET Core Blazor Windows Forms
The recurrence settings specified in this dialog comprise the Recurrence Pattern.
A recurring event’s recurrence settings are stored in the Recurrence Pattern. When the Scheduler module needs to visualize the recurring event’s occurrences on a time line, it reads the recurrence settings from the Recurrence Pattern. However, a recurring event is not really useful in real-life applications if you cannot customize its individual occurrences. For instance, if you have a recurring event that represents a weekly meeting, you may want to specify that the next week’s meeting starts an hour later than usual. You cannot do this in the event’s Recurrence dialog. Instead, you can edit the required occurrence on the Scheduler’s time line. The Scheduler module handles such customizations automatically with the help of a special collection associated with the event. This collection stores all the occurrences of the event that were changed or deleted. So, a recurring event is defined by its Recurrence Pattern and the collection of changes.
To edit a single occurrence of a recurring event, double-click the event or click the event and click Edit in the tooltip. In the displayed dialog select Edit appointment.
To edit the series, click the event and click Edit in the tooltip. In the displayed dialog select either Edit series or Edit appointment.
If an occurrence has been modified, you can restore its settings to the ones used in the series it belongs to. To do this, use the Restore Occurrence command.
To edit a single occurrence of a recurring event, invoke the context menu and click Open. To change the settings of all the occurrences, except those that have been changed or deleted, click Edit Series :
If an occurrence has been modified, you can restore its settings to the ones used in the series it belongs to. To do this, use the Restore Default State command.
The code sample below shows how to create recurrent events programmatically. You can reuse this code in the Updater class of your XAF application to populate your database with data.
See Also
How to: Perform Custom Actions When an Exception is Added to a Recurring Event