Exemple #1
0
 private static Microsoft.Exchange.Connections.Eas.Model.Request.Calendar.Exception GetExceptionData(Event exceptionalEvent, bool isMeeting, ExDateTime masterStart, UserSmtpAddress userSmtpAddress)
 {
     Microsoft.Exchange.Connections.Eas.Model.Request.Calendar.Exception ex = new Microsoft.Exchange.Connections.Eas.Model.Request.Calendar.Exception();
     ex.ExceptionStartTime = SyncCalendarUtils.GetExceptionStartDate(exceptionalEvent.Id, masterStart);
     SyncCalendarUtils.CopyCommonEventData(ex, exceptionalEvent, isMeeting, userSmtpAddress);
     return(ex);
 }
Exemple #2
0
        public static ApplicationData ConvertEventToAppData(Event theEvent, IList <Event> exceptionalEvents, IList <string> deletedOccurrences, UserSmtpAddress userSmtpAddress)
        {
            ExTimeZone utcTimeZone;

            if (theEvent.IntendedStartTimeZoneId == "tzone://Microsoft/Utc" || theEvent.IntendedStartTimeZoneId == null)
            {
                utcTimeZone = ExTimeZone.UtcTimeZone;
            }
            else
            {
                ExTimeZoneEnumerator.Instance.TryGetTimeZoneByName(theEvent.IntendedStartTimeZoneId, out utcTimeZone);
            }
            bool flag = false;
            byte b    = 0;

            if (theEvent.HasAttendees)
            {
                b   |= 1;
                flag = true;
            }
            if (theEvent.IsCancelled)
            {
                b |= 4;
            }
            if (((IEventInternal)theEvent).IsReceived)
            {
                b |= 2;
            }
            ApplicationData applicationData = new ApplicationData();

            SyncCalendarUtils.CopyCommonEventData(applicationData, theEvent, flag, userSmtpAddress);
            applicationData.TimeZone      = ((utcTimeZone != null) ? SyncCalendarUtils.ToTimeZoneString(utcTimeZone) : null);
            applicationData.MeetingStatus = new byte?(b);
            applicationData.Uid           = (string.IsNullOrEmpty(((IEventInternal)theEvent).GlobalObjectId) ? null : new GlobalObjectId(((IEventInternal)theEvent).GlobalObjectId).Uid);
            applicationData.Recurrence    = SyncCalendarUtils.GetRecurrenceData(theEvent.PatternedRecurrence);
            applicationData.Exceptions    = SyncCalendarUtils.GetExceptionData(exceptionalEvents, deletedOccurrences, flag, theEvent.Start, userSmtpAddress);
            if (flag)
            {
                applicationData.OrganizerEmail    = theEvent.Organizer.EmailAddress;
                applicationData.OrganizerName     = theEvent.Organizer.Name;
                applicationData.ResponseRequested = new byte?(Convert.ToByte(theEvent.ResponseRequested));
            }
            return(applicationData);
        }