Ejemplo n.º 1
0
        public CalendarItemCollection Apply(CalendarItemCollection calendarItems)
        {
            var req = new ApplyRequest()
            {
                CalendarItems = calendarItems
            };

#if false
            using (var w = new StreamWriter(@"d:\temp\apply.txt", false, new UTF8Encoding(false)))
            {
                _serializer.Serialize(w, req);
            }
#endif
            var res = (ApplyResponse)SendReceive(req);
            return(res.CalendarItems);
        }
Ejemplo n.º 2
0
 private void AddCalendarItemsWithoutGuid(CalendarItemCollection calendarItems, GatheredCalenderItems.CalendarItemTypes itemType)
 {
     foreach (var calendarItem in calendarItems)
     {
         if (calendarItem.SyngronizeGuid == Guid.Empty)
         {
             var gatheredCalendarItems = FindGatheredCalendarItems(calendarItem);
             if (gatheredCalendarItems == null)
             {
                 var guid = Guid.NewGuid();
                 gatheredCalendarItems           = new GatheredCalenderItems(guid);
                 _gatheredCalendarItemDict[guid] = gatheredCalendarItems;
             }
             gatheredCalendarItems.AddItem(calendarItem, itemType);
         }
     }
 }
Ejemplo n.º 3
0
 private void AddCalendarItemsWithGuid(CalendarItemCollection calendarItems, GatheredCalenderItems.CalendarItemTypes itemType)
 {
     foreach (var calendarItem in calendarItems)
     {
         if (calendarItem.SyngronizeGuid != Guid.Empty)
         {
             var guid = calendarItem.SyngronizeGuid;
             var gatheredCalendarItems = default(GatheredCalenderItems);
             var r = _gatheredCalendarItemDict.TryGetValue(guid, out gatheredCalendarItems);
             if (r == false)
             {
                 gatheredCalendarItems           = new GatheredCalenderItems(guid);
                 _gatheredCalendarItemDict[guid] = gatheredCalendarItems;
             }
             gatheredCalendarItems.AddItem(calendarItem, itemType);
         }
     }
 }
Ejemplo n.º 4
0
 public CalendarItemSynchronizer(CalendarItemCollection googleCalendarItems, CalendarItemCollection outlookCalendarItems)
 {
     _googleCalendarItems  = googleCalendarItems;
     _outlookCalendarItems = outlookCalendarItems;
 }