示例#1
0
        // Token: 0x06001E27 RID: 7719 RVA: 0x000AEF7C File Offset: 0x000AD17C
        private GSCalendarItem[] GetItemsFromEventArray(CalendarEvent[] eventArray)
        {
            List <GSCalendarItem> list = new List <GSCalendarItem>(eventArray.Length);

            foreach (CalendarEvent calendarEvent in eventArray)
            {
                ExDateTime exDateTime  = new ExDateTime(this.userContext.TimeZone, calendarEvent.StartTime);
                ExDateTime exDateTime2 = new ExDateTime(this.userContext.TimeZone, calendarEvent.EndTime);
                if (exDateTime > exDateTime2)
                {
                    ExTraceGlobals.CalendarDataTracer.TraceDebug(0L, "Skipping appointment with an end time earlier than a start time");
                }
                else
                {
                    for (int j = 0; j < this.dateRanges.Length; j++)
                    {
                        if (this.dateRanges[j].Intersects(exDateTime, exDateTime2))
                        {
                            GSCalendarItem gscalendarItem = new GSCalendarItem();
                            gscalendarItem.StartTime = exDateTime;
                            gscalendarItem.EndTime   = exDateTime2;
                            gscalendarItem.BusyType  = this.ConvertBusyType(calendarEvent.BusyType);
                            if (calendarEvent.CalendarEventDetails != null)
                            {
                                CalendarEventDetails calendarEventDetails = calendarEvent.CalendarEventDetails;
                                gscalendarItem.Subject   = calendarEventDetails.Subject;
                                gscalendarItem.Location  = calendarEventDetails.Location;
                                gscalendarItem.IsMeeting = calendarEventDetails.IsMeeting;
                                gscalendarItem.IsPrivate = calendarEventDetails.IsPrivate;
                                if (calendarEventDetails.IsException)
                                {
                                    gscalendarItem.CalendarItemType = CalendarItemTypeWrapper.Exception;
                                }
                                else if (calendarEventDetails.IsRecurring)
                                {
                                    gscalendarItem.CalendarItemType = CalendarItemTypeWrapper.Occurrence;
                                }
                                else
                                {
                                    gscalendarItem.CalendarItemType = CalendarItemTypeWrapper.Single;
                                }
                            }
                            else
                            {
                                gscalendarItem.CalendarItemType = CalendarItemTypeWrapper.Single;
                            }
                            list.Add(gscalendarItem);
                            break;
                        }
                    }
                }
            }
            return(list.ToArray());
        }
示例#2
0
 // Token: 0x06001E29 RID: 7721 RVA: 0x000AF1C4 File Offset: 0x000AD3C4
 private void CheckAndAddCurrentItem(IList <GSCalendarItem> itemList, ref GSCalendarItem currentItem, int i)
 {
     currentItem.EndTime = this.GetDateTimeFromIndex(i);
     for (int j = 0; j < this.dateRanges.Length; j++)
     {
         if (this.dateRanges[j].Intersects(currentItem.StartTime, currentItem.EndTime))
         {
             itemList.Add(currentItem);
             break;
         }
     }
     currentItem = null;
 }
示例#3
0
        // Token: 0x06001E28 RID: 7720 RVA: 0x000AF0F0 File Offset: 0x000AD2F0
        private GSCalendarItem[] GetItemsFromMergedFreeBusy(string mergedFreeBusy)
        {
            List <GSCalendarItem> list            = new List <GSCalendarItem>(mergedFreeBusy.Length);
            GSCalendarItem        gscalendarItem  = null;
            BusyTypeWrapper       busyTypeWrapper = BusyTypeWrapper.Free;
            int i;

            for (i = 0; i < mergedFreeBusy.Length; i++)
            {
                int num;
                if (!int.TryParse(mergedFreeBusy[i].ToString(), out num) || num < 0 || num > 4)
                {
                    ExTraceGlobals.CalendarDataTracer.TraceDebug(0L, "Availability Service returns invalid data in MergedFreeBusy:" + mergedFreeBusy[i]);
                }
                else
                {
                    BusyTypeWrapper busyTypeWrapper2 = (BusyTypeWrapper)num;
                    if (busyTypeWrapper2 != busyTypeWrapper)
                    {
                        busyTypeWrapper = busyTypeWrapper2;
                        if (gscalendarItem != null)
                        {
                            this.CheckAndAddCurrentItem(list, ref gscalendarItem, i);
                        }
                        if (busyTypeWrapper2 != BusyTypeWrapper.Free)
                        {
                            gscalendarItem = new GSCalendarItem
                            {
                                StartTime        = this.GetDateTimeFromIndex(i),
                                BusyType         = busyTypeWrapper2,
                                CalendarItemType = CalendarItemTypeWrapper.Single
                            };
                        }
                    }
                }
            }
            if (gscalendarItem != null)
            {
                this.CheckAndAddCurrentItem(list, ref gscalendarItem, i);
            }
            return(list.ToArray());
        }