Back to Devexpress

Appointment.Type Property

corelibraries-devexpress-dot-xtrascheduler-dot-appointment-f2ceba11.md

latest8.2 KB
Original Source

Appointment.Type Property

Gets the type of an appointment.

Namespace : DevExpress.XtraScheduler

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

NuGet Package : DevExpress.Scheduler.Core

Declaration

csharp
AppointmentType Type { get; }
vb
ReadOnly Property Type As AppointmentType

Property Value

TypeDescription
AppointmentType

An AppointmentType enumeration value which specifies the appointment’s type.

|

Available values:

NameDescription
Normal

Represents a standard (non-recurring) appointment.

| | Pattern |

Represents the appointment which serves as the pattern for the other recurring appointments. The pattern for recurring appointments is specified via the Appointment.RecurrenceInfo property.

| | Occurrence |

Represents a recurring appointment whose pattern appointment is specified via the Appointment.RecurrencePattern property.

| | ChangedOccurrence |

Represents a recurring appointment, which was changed and now doesn’t satisfy the pattern of the recurring series.

| | DeletedOccurrence |

Represents a recurring appointment which was deleted from the series of other recurring appointments of the same pattern.

|

Remarks

Appointment type cannot be changed directly. The type of the appointment is specified by its role (normal, recurring, changed from recurring series (exception), etc.). All available types are listed in the AppointmentType enumeration.

When you map the Appointment.Type property to the data field, use the field of the int type. The AppointmentType members are enumerated as follows:

  • Normal = 0,
  • Pattern = 1,
  • Occurrence = 2,
  • ChangedOccurrence = 3,
  • DeletedOccurrence = 4

The following code snippets (auto-collected from DevExpress Examples) contain references to the Type property.

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-sync-with-ews/CS/EWSSyncExample/ExchangeExampleForm.cs#L48

csharp
foreach(var schedulerAppointment in schedulerDataStorage1.Appointments.Items)
    if((schedulerAppointment.Type == DevExpress.XtraScheduler.AppointmentType.Normal) || (schedulerAppointment.Type == DevExpress.XtraScheduler.AppointmentType.Pattern))
        // Export Patern and Normal Appointments to Exchange.

winforms-scheduler-get-appointment-by-source-object/CS/Form1.cs#L39

csharp
RegisterAppointmentRows(apts);
if (apt.Type == AppointmentType.Pattern) {
    RegisterAppointmentRows(apt.GetExceptions());

winforms-scheduler-recurrence-series-occurrencecalculator/CS/OccurrenceCalculatorSample/Form1.cs#L41

csharp
// Calculate occurrences for the first recurrent series.
Appointment pattern = schedulerStorage1.Appointments.Items.FirstOrDefault(item => item.Type == AppointmentType.Pattern);
if (pattern == null) return;

winforms-scheduler-sync-outlook-calendars/CS/SyncWithOutlook/OutlookSynchronizerHelper.cs#L116

csharp
Appointment currentAppointment = e.Object as Appointment;
if(currentAppointment.CustomFields[OutlookEntryIDFieldName] != null && (currentAppointment.Type == AppointmentType.Normal || currentAppointment.Type == AppointmentType.Pattern)) {
    deletedAppointments.Add(currentAppointment.CustomFields[OutlookEntryIDFieldName].ToString());

winforms-scheduler-create-appointments-on-reminder-alert/CS/ReminderCustomActions/Form1.cs#L65

csharp
Appointment apt = e.ViewInfo.Appointment;
if (apt.HasReminder && apt.Type == AppointmentType.Occurrence && apt.RecurrencePattern != null) {
    Appointment pattern = apt.RecurrencePattern;

winforms-scheduler-sync-with-ews/VB/EWSSyncExample/ExchangeExampleForm.vb#L51

vb
For Each schedulerAppointment In schedulerDataStorage1.Appointments.Items
    If (schedulerAppointment.Type = DevExpress.XtraScheduler.AppointmentType.Normal) OrElse (schedulerAppointment.Type = DevExpress.XtraScheduler.AppointmentType.Pattern) Then
        ' Export Patern and Normal Appointments to Exchange.

winforms-scheduler-get-appointment-by-source-object/VB/Form1.vb#L48

vb
RegisterAppointmentRows(apts)
If apt.Type = AppointmentType.Pattern Then
    RegisterAppointmentRows(apt.GetExceptions())

winforms-scheduler-recurrence-series-occurrencecalculator/VB/OccurrenceCalculatorSample/Form1.vb#L39

vb
' Calculate occurrences for the first recurrent series.
Dim pattern As Appointment = schedulerStorage1.Appointments.Items.FirstOrDefault(Function(item) item.Type = AppointmentType.Pattern)
If pattern Is Nothing Then Return

winforms-scheduler-sync-outlook-calendars/VB/SyncWithOutlook/OutlookSynchronizerHelper.vb#L155

vb
Dim currentAppointment As Appointment = TryCast(e.Object, Appointment)
If currentAppointment.CustomFields(OutlookEntryIDFieldName) IsNot Nothing AndAlso (currentAppointment.Type = AppointmentType.Normal OrElse currentAppointment.Type = AppointmentType.Pattern) Then
    deletedAppointments.Add(currentAppointment.CustomFields(OutlookEntryIDFieldName).ToString())

winforms-scheduler-create-appointments-on-reminder-alert/VB/ReminderCustomActions/Form1.vb#L67

vb
Dim apt As Appointment = e.ViewInfo.Appointment
If apt.HasReminder AndAlso apt.Type = AppointmentType.Occurrence AndAlso apt.RecurrencePattern IsNot Nothing Then
    Dim pattern As Appointment = apt.RecurrencePattern

See Also

Appointment Interface

Appointment Members

DevExpress.XtraScheduler Namespace