windowsforms-devexpress-dot-xtrascheduler-dot-microsoft365calendar-dot-dxoutlook365sync-e4c82ae2.md
Allows you to specify a merge action based on a condition.
Namespace : DevExpress.XtraScheduler.Microsoft365Calendar
Assembly : DevExpress.XtraScheduler.v25.2.Microsoft365Calendar.dll
NuGet Package : DevExpress.Scheduler.Core.Desktop.Microsoft365Calendar
public event EventHandler<Outlook365CalendarMergeEventArgs> MergeSingleItem
Public Event MergeSingleItem As EventHandler(Of Outlook365CalendarMergeEventArgs)
The MergeSingleItem event's data class is Outlook365CalendarMergeEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| ActionType | Gets or sets a merge action. |
| Handled | Gets or sets a value that specifies whether a merge operation was handled and no default processing is required. |
| IsMergeConflict | Gets a value that indicates whether a merge conflict was detected. |
| OutlookEvent | Gets a source event in a user calendar or the default calendar in Outlook365. |
| SchedulerAppointment | Gets a source appointment. |
| TargetOutlookEvent | Gets or sets the target Outlook 365 event. |
| TargetSchedulerAppointment | Gets or sets the target appointment. |
The event data class exposes the following methods:
| Method | Description |
|---|---|
| ConvertAppointmentToEvent(Appointment) | Converts the specified appointment to an Outlook 365 event. |
| ConvertEventToAppointment(Event, String, Boolean) | Converts the specified Outlook 365 event to an appointment. |
The MergeSingleItem event occurs for each appointment/event pair during an export, an import, or a merge operation and allows you to redefine a merge action based on a condition. Use the e.ActionType property to specify the merge action.
The following example demonstrates how to import Outlook 365 events that have not started.
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;
}
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 MergeSingleItem event.
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#L23
dxOutlook365Sync1.InitComplete += DxOutlook365Sync1_InitComplete;
dxOutlook365Sync1.MergeSingleItem += DxOutlook365Sync1_MergeSingleItem;
dxOutlook365Sync1.MergeConflictResolve += DxOutlook365Sync1_MergeConflictResolve;
winforms-scheduler-synchronize-appointments-with-outlook-365/VB/DXOutlook365Sync/Form1.vb#L24
AddHandler dxOutlook365Sync1.InitComplete, AddressOf DxOutlook365Sync1_InitComplete
AddHandler dxOutlook365Sync1.MergeSingleItem, AddressOf DxOutlook365Sync1_MergeSingleItem
AddHandler dxOutlook365Sync1.MergeConflictResolve, AddressOf DxOutlook365Sync1_MergeConflictResolve
See Also