Back to Devexpress

DXGoogleCalendarSync.ConflictDetected Event

windowsforms-devexpress-dot-xtrascheduler-dot-googlecalendar-dot-dxgooglecalendarsync-103da376.md

latest5.0 KB
Original Source

DXGoogleCalendarSync.ConflictDetected Event

Raises when the DXGoogleCalendarSync component is uncertain whether it should copy Scheduler Appointment data to a corresponding Google Event, or vice versa.

Namespace : DevExpress.XtraScheduler.GoogleCalendar

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

NuGet Package : DevExpress.Win.Scheduler.GoogleCalendar

Declaration

csharp
public event ConflictDetectedEventHandler ConflictDetected
vb
Public Event ConflictDetected As ConflictDetectedEventHandler

Event Data

The ConflictDetected event's data class is ConflictDetectedEventArgs. The following properties provide information specific to this event:

PropertyDescription
AppointmentProvides access to a Scheduler Appointment associated with this conflict.
ConflictOperationTypeReturns the conflict type. Allows you to determine whether the conflict has emerged for a newly created or an edited Event/Appointment.
EventProvides access to a Google Event associated with this conflict.
GoogleEventIsValidGets or sets whether the DXGoogleCalendarSync should copy a Google Event data into a Scheduler Appointment.

Remarks

The ConflictDetected event occurs, for instance, when you edit both a Scheduler Appointment and its corresponding Google Event. This produces an ambiguous scenario where it is unclear which of the Event-Appointment objects should be considered “valid”. Handle the ConflictDetected event to manually choose this “valid” object.

csharp
private void GcSyncComponent_ConflictDetected(object sender, ConflictDetectedEventArgs e) {
    if (
        //implement your condition here 
        //you can read the e.Appointment and e.Event parameters to compare conflicting objects 
        ) {
        e.GoogleEventIsValid = false;
    }
}
vb
Private Sub GcSyncComponent_ConflictDetected(ByVal sender As Object, ByVal e As ConflictDetectedEventArgs)
    If Then 
        'implement your condition here 
        'you can read the e.Appointment and e.Event parameters to compare conflicting objects 
        e.GoogleEventIsValid = False 
    End If 
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ConflictDetected 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-sync-with-google-calendars/CS/GCSync/Form1.cs#L33

csharp
bbiSynchronize.ItemClick += BbiSynchronize_ItemClick;
gcSyncComponent.ConflictDetected += GcSyncComponent_ConflictDetected;

winforms-scheduler-sync-with-google-calendars/VB/GCSync/Form1.vb#L39

vb
AddHandler bbiSynchronize.ItemClick, AddressOf BbiSynchronize_ItemClick
    AddHandler gcSyncComponent.ConflictDetected, AddressOf GcSyncComponent_ConflictDetected
End Sub

See Also

Google Calendars

DXGoogleCalendarSync Class

DXGoogleCalendarSync Members

DevExpress.XtraScheduler.GoogleCalendar Namespace