Back to Devexpress

Outlook365CalendarMergeEventArgs.ActionType Property

windowsforms-devexpress-dot-xtrascheduler-dot-microsoft365calendar-dot-outlook365calendarmergeeventargs-1736f4a5.md

latest4.4 KB
Original Source

Outlook365CalendarMergeEventArgs.ActionType Property

Gets or sets a merge action.

Namespace : DevExpress.XtraScheduler.Microsoft365Calendar

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

NuGet Package : DevExpress.Scheduler.Core.Desktop.Microsoft365Calendar

Declaration

csharp
public MergeActionType ActionType { get; set; }
vb
Public Property ActionType As MergeActionType

Property Value

TypeDescription
MergeActionType

A value that specifies the merge action.

|

Available values:

NameDescription
DoNothing

Do nothing.

| | InsertOrUpdateAppointment |

Insert or update an appointment.

| | InsertOrUpdateEvent |

Insert or update an event.

| | DeleteAppointment |

Delete an appointment.

| | DeleteEvent |

Delete an event.

|

Remarks

The following example demonstrates how to import Outlook 365 events that have not started.

csharp
using DevExpress.XtraScheduler.Microsoft365Calendar;

dxOutlook365Sync1.MergeSingleItem += DxOutlook365Sync1_MergeSingleItem;
private void DxOutlook365Sync1_MergeSingleItem(object sender, Outlook365CalendarMergeEventArgs e) {
    if(e.OutlookEvent != null && e.OutlookEvent.Start.ToDateTime() < DateTime.Now)
        e.ActionType = MergeActionType.DoNothing;
}
vb
Imports DevExpress.XtraScheduler.Microsoft365Calendar

Private dxOutlook365Sync1.MergeSingleItem += AddressOf DxOutlook365Sync1_MergeSingleItem
Private Sub DxOutlook365Sync1_MergeSingleItem(ByVal sender As Object, ByVal e As Outlook365CalendarMergeEventArgs)
    If e.OutlookEvent IsNot Nothing AndAlso e.OutlookEvent.Start.ToDateTime() < Date.Now Then
        e.ActionType = MergeActionType.DoNothing
    End If
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ActionType 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-synchronize-appointments-with-outlook-365/CS/DXOutlook365Sync/Form1.cs#L32

csharp
// Otherwise, the Outlook365 event is copied to the Scheduler control.
    e.ActionType = appointmentLastModified > eventLastModified ? MergeActionType.InsertOrUpdateEvent : MergeActionType.InsertOrUpdateAppointment;
}

winforms-scheduler-synchronize-appointments-with-outlook-365/VB/DXOutlook365Sync/Form1.vb#L33

vb
' Otherwise, the Outlook365 event is copied to the Scheduler control.
    e.ActionType = If(appointmentLastModified > eventLastModified, MergeActionType.InsertOrUpdateEvent, MergeActionType.InsertOrUpdateAppointment)
End Sub

See Also

Synchronization with Microsoft 365 Calendars

Outlook365CalendarMergeEventArgs Class

Outlook365CalendarMergeEventArgs Members

DevExpress.XtraScheduler.Microsoft365Calendar Namespace