Skip to main content
A newer version of this page is available. .

SchedulerControlCompatibility.DefaultOccurrenceCount Property

Gets or sets default value of the RecurrenceInfo.OccurrenceCount property.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v18.2.Core.dll

Declaration

[DefaultValue(10)]
public static int DefaultOccurrenceCount { get; set; }

Property Value

Type Default Description
Int32 10

An integer that specifies the number of occurrences in a series.

Remarks

Gets or sets the value used as the default number of occurrences in the recurrence series if the RecurrenceInfo.OccurrenceCount is not specified explicitly.

Note

If your application always sets the number of occurrences explicitly or if you do not experience problems with the number of occurrences after upgrading, the following information is not relevant for you.

To provide backward compatibility with the recurrence patterns created with SchedulerControl prior to version 14.2.8, we have introduced the static SchedulerControlCompatibility.DefaultOccurrenceCount property. Set this property to 1 to force SchedulerControl to restore recurrence patterns with the RecurrenceInfo.OccurrenceCount default value set to 1.


DevExpress.XtraScheduler.SchedulerControlCompatibility.DefaultOccurrenceCount = 1;

Currently we use 10 as the default value of the RecurrenceInfo.OccurrenceCount property. So, if a user sets the occurrence count to 10, the RecurrenceInfo.OccurrenceCount property value is not serialized to XML, since the value equals the default value. In this case, SchedulerControl will generate the number of occurrences specified by the SchedulerControlCompatibility.DefaultOccurrenceCount property.

In fact, an appointment pattern with the RecurrenceInfo.OccurrenceCount property set to 1 behaves like a regular appointment. So, to avoid the ambiguity that occurred after changing the default RecurrenceInfo.OccurrenceCount property value while serializing appointments into XML, we recommend you perform the following steps:

  1. Set the SchedulerControlCompatibility.DefaultOccurrenceCount property to 1. As a result, appointment patterns will be restored as expected.
  2. Get all the appointment patterns with the RecurrenceInfo.OccurrenceCount property set to 1. Check the Appointment.Type property to find appointment patterns.
  3. Replace a generated occurrence for each pattern with a regular appointment. You can find an example of replacing a recurrence pattern with a regular appointment in the OccurrenceCalculator topic.
  4. Post the modified data into the database.
  5. Remove the line that changes the SchedulerControlCompatibility.DefaultOccurrenceCount property. A default value of 10 will be used for the RecurrenceInfo.OccurrenceCount property.
See Also