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

AppointmentItem.CreateException(AppointmentType, Int32) Method

OBSOLETE

Use the following API instead: var exception = scheduler.GetOccurrenceOrException(pattern, recurrenceIndex: 0); exception.Type = AppointmentType.ChangedOccurrence; //AppointmentType.DeletedOccurrence) Or create a new AppointmentItem manually: var newException = scheduler.CreateAppointmentItem(); newException.Type = AppointmentType.ChangedOccurrence; //AppointmentType.DeletedOccurrence newException.SetPatternReference(pattern.RecurrenceInfoId, recurrenceIndex: 1); scheduler.AppointmentItems.Add(newException);

Creates an appointment that is an exception in a recurring series.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v18.2.dll

Declaration

[Obsolete("Use the following API instead:\r\nvar exception = scheduler.GetOccurrenceOrException(pattern, recurrenceIndex: 0);\r\nexception.Type = AppointmentType.ChangedOccurrence; //AppointmentType.DeletedOccurrence)\r\n\r\nOr create a new AppointmentItem manually: \r\nvar newException = scheduler.CreateAppointmentItem();\r\nnewException.Type = AppointmentType.ChangedOccurrence; //AppointmentType.DeletedOccurrence\r\nnewException.SetPatternReference(pattern.RecurrenceInfoId, recurrenceIndex: 1);\r\nscheduler.AppointmentItems.Add(newException);", false)]
public AppointmentItem CreateException(
    AppointmentType type,
    int recurrenceIndex
)

Parameters

Name Type Description
type AppointmentType

An AppointmentType value that specifies the type of the exception.

recurrenceIndex Int32

A zero-based integer which specifies the new appointment’s index in the recurring series.

Returns

Type Description
AppointmentItem

An AppointmentItem object which is the newly created exception.

Remarks

Call the CreateException method of the pattern appointment to create exceptions (changed and deleted occurrences) in the recurring series defined by that pattern. Use the Appointment.RecurrencePattern property to obtain a pattern appointment.

Important

If the current appointment is not a pattern (its Appointment.Type is not AppointmentType.Pattern), then calling the CreateException method throws an exception.

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.

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.

See Also