Skip to main content

Appointment.CreateException(AppointmentType, Int32) Method

Creates an exceptional appointment within a chain of recurring appointments.

Namespace: DevExpress.XtraScheduler

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

#Declaration

public Appointment CreateException(
    AppointmentType type,
    int recurrenceIndex
)

#Parameters

Name Type Description
type AppointmentType

An AppointmentType value that specifies the type of the exceptional appointment to be created.

recurrenceIndex Int32

A zero-based integer which identifies the index in the chain of recurring appointments at which the new exceptional appointment will be created.

#Returns

Type Description
Appointment

An Appointment object which specifies the newly created exceptional appointment.

#Remarks

To create a recurring appointment you should create a pattern appointment (its Appointment.Type property should be set to AppointmentType.Pattern) and specify the recurrence rule via the Appointment.RecurrenceInfo property. At run time, each pattern appointment generates a series of appointments, called a "recurrence chain". A recurrence chain is a series of regular occurrences (individual appointments) which will occur one after another at specified time intervals. An individual appointment (regular occurrence) in the chain has its Appointment.Type property set to AppointmentType.Occurrence. Each occurrence in the chain is identified by a zero-based recurrence index specified by the Appointment.RecurrenceIndex property.

The CreateException method allows you to modify an appointment (individual occurrence) in the chain when you have to change its location or start time. Also, you can delete an individual occurrence so it is excluded from the recurrence chain. The method's recurrenceIndex parameter identifies the index of the appointment in the recurrence chain to be modified or deleted.

To modify a regular occurrence, call the CreateException method with the type parameter set to AppointmentType.ChangedOccurrence. As a result, a new appointment will be created based upon the pattern, and it will replace the specified regular occurrence. You can then change the settings of the new appointment as required.

To delete a regular occurrence, call the CreateException method with the type parameter set to AppointmentType.DeletedOccurrence. A new hidden appointment will be created so it replaces the regular occurrence at the specified recurrence index.

Use the Appointment.RestoreOccurrence method to restore the default state and settings of an individual occurrence.

See Also