Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DXGoogleCalendarSync.FilterAppointments Event

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

Namespace: DevExpress.XtraScheduler.GoogleCalendar

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

NuGet Package: DevExpress.Win.Scheduler.GoogleCalendar

#Declaration

public event EventHandler<FilterAppointmentsEventArgs> FilterAppointments

#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.

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;
}
See Also