Exemplo n.º 1
0
        void synchronizer_AppointmentImportSynchronizing(object sender, DevExpress.XtraScheduler.AppointmentSynchronizingEventArgs e)
        {
            if (e.Operation == SynchronizeOperation.Delete)
            {
                return;
            }

            // prevent appointments with other UserID from being created or updated
            OutlookAppointmentSynchronizingEventArgs args = (OutlookAppointmentSynchronizingEventArgs)e;

            e.Cancel = GetOutlookAppointmentUserId(args.OutlookAppointment) != UserID;
        }
Exemplo n.º 2
0
        void synchronizer_AppointmentExportSynchronizing(object sender, DevExpress.XtraScheduler.AppointmentSynchronizingEventArgs e)
        {
            OutlookAppointmentSynchronizingEventArgs args = (OutlookAppointmentSynchronizingEventArgs)e;

            // Prevent appointments with other UserID from being deleted
            if (e.Operation == SynchronizeOperation.Delete)
            {
                if (GetOutlookAppointmentUserId(args.OutlookAppointment) != UserID)
                {
                    e.Cancel = true;
                    return;
                }
            }
            // Mark the new Outlook appoinment item with UserID
            if (e.Operation == SynchronizeOperation.Create)
            {
                SetOutlookAppointmentUserId(args.OutlookAppointment);
            }
        }