corelibraries-devexpress-dot-xtrascheduler-dot-appointment-dot-getoccurrence-x28-system-dot-int32-x29.md
Gets an occurrence at the specified position within a series of recurring appointments.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.Core.dll
NuGet Package : DevExpress.Scheduler.Core
Appointment GetOccurrence(
int recurrenceIndex
)
Function GetOccurrence(
recurrenceIndex As Integer
) As Appointment
| Name | Type | Description |
|---|---|---|
| recurrenceIndex | Int32 |
A zero-based integer which identifies the index of an occurrence in the series of recurring appointments.
|
| Type | Description |
|---|---|
| Appointment |
An Appointment object which is an occurrence at the specified position.
|
An appointment of the AppointmentType.Pattern type starts the series of recurring appointments. Each occurrence in the series is identified by a zero-based recurrence index specified by the Appointment.RecurrenceIndex property.
The GetOccurrence method allows you to get an occurrence at the specified position. If an occurrence at the specified position has been modified, the GetOccurrence method returns the modified occurrence (appointment exception). If an occurrence at the specified position is deleted, the GetOccurrence method returns null.
Note
If the current appointment is not a patten (its Appointment.Type is not AppointmentType.Pattern), then the ArgumentException exception is thrown.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetOccurrence(Int32) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-scheduler-create-appointments-on-reminder-alert/CS/ReminderCustomActions/Form1.cs#L120
if (apt != null && apt.IsRecurring) {
Appointment nextOcc = apt.RecurrencePattern.GetOccurrence(apt.RecurrenceIndex + 1);
memoEdit1.Text = "The next occurrence has index " + nextOcc.RecurrenceIndex + " and Price=" + nextOcc.CustomFields["CustomPrice"]
winforms-scheduler-create-appointments-on-reminder-alert/VB/ReminderCustomActions/Form1.vb#L124
If apt IsNot Nothing AndAlso apt.IsRecurring Then
Dim nextOcc As Appointment = apt.RecurrencePattern.GetOccurrence(apt.RecurrenceIndex + 1)
memoEdit1.Text = "The next occurrence has index " & nextOcc.RecurrenceIndex & " and Price=" & nextOcc.CustomFields("CustomPrice").ToString() & vbCrLf
See Also