Back to Devexpress

DXGoogleCalendarSync.FilterAppointments Event

windowsforms-devexpress-dot-xtrascheduler-dot-googlecalendar-dot-dxgooglecalendarsync-15616404.md

latest2.8 KB
Original Source

DXGoogleCalendarSync.FilterAppointments Event

Allows you to skip certain Scheduler Appointments and\or Google Calendar Events during synchronization.

Namespace : DevExpress.XtraScheduler.GoogleCalendar

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

NuGet Package : DevExpress.Win.Scheduler.GoogleCalendar

Declaration

csharp
public event EventHandler<FilterAppointmentsEventArgs> FilterAppointments
vb
Public Event FilterAppointments As EventHandler(Of FilterAppointmentsEventArgs)

Event Data

The FilterAppointments event's data class is DevExpress.XtraScheduler.GoogleCalendar.FilterAppointmentsEventArgs.

Remarks

When the DXGoogleCalendarSync component finds a new appointment/event, it fires the FilterAppointments event with this new object stored in either e.Appointment or e.Event parameter. You can read these parameters and check appointment/event settings. If this object should not be synchronized (a Google Calendar or Scheduler Control should not create a matching event/appointment), set the e.Cancel parameter to true.

The sample below illustrates how to skip all appointments that have “test” in their descriptions, and all Google Events with the “tentative” status.

csharp
private void GcSyncComponent_FilterAppointments(object sender, FilterAppointmentsEventArgs e) {
    if (e.Appointment!=null && e.Appointment.Description.Contains("test"))
        e.Cancel = true;
    if (e.Event!=null && e.Event.Status == "tentative")
        e.Cancel = true;
}
vb
Private Sub GcSyncComponent_FilterAppointments(ByVal sender As Object, ByVal e As FilterAppointmentsEventArgs)
    If e.Appointment IsNot Nothing AndAlso e.Appointment.Description.Contains("test") Then
        e.Cancel = True
    End If
    If e.Event IsNot Nothing AndAlso e.Event.Status = "tentative" Then
        e.Cancel = True
    End If
End Sub

See Also

DXGoogleCalendarSync Class

DXGoogleCalendarSync Members

DevExpress.XtraScheduler.GoogleCalendar Namespace