Exemplo n.º 1
0
 private void CopyToCalendarItem(Item promotedItem, CalendarItemBase calendarItem, bool itemCreated)
 {
     foreach (PropertyDefinition propertyDefinition in InternetCalendarSchema.ImportUpdate)
     {
         object obj = promotedItem.TryGetProperty(propertyDefinition);
         if (obj != null && !PropertyError.IsPropertyNotFound(obj))
         {
             if (propertyDefinition == CalendarItemBaseSchema.AppointmentRecurrenceBlob && !itemCreated)
             {
                 CalendarItem calendarItem2 = calendarItem as CalendarItem;
                 if (calendarItem2 != null)
                 {
                     InternalRecurrence recurrenceFromItem = CalendarItem.GetRecurrenceFromItem(promotedItem);
                     InternalRecurrence internalRecurrence = new InternalRecurrence(recurrenceFromItem.Pattern, recurrenceFromItem.Range, calendarItem2, recurrenceFromItem.CreatedExTimeZone, recurrenceFromItem.ReadExTimeZone, recurrenceFromItem.StartOffset, recurrenceFromItem.EndOffset);
                     RecurrenceBlobMerger.Merge(null, null, calendarItem.GlobalObjectId, recurrenceFromItem, internalRecurrence);
                     calendarItem2.Recurrence = internalRecurrence;
                     goto IL_9C;
                 }
             }
             calendarItem[propertyDefinition] = obj;
         }
         else
         {
             calendarItem.Delete(propertyDefinition);
         }
         IL_9C :;
     }
     using (TextReader textReader = promotedItem.Body.OpenTextReader(BodyFormat.ApplicationRtf))
     {
         using (TextWriter textWriter = calendarItem.Body.OpenTextWriter(BodyFormat.ApplicationRtf))
         {
             Util.StreamHandler.CopyText(textReader, textWriter);
         }
     }
     calendarItem.CoreItem.Recipients.CopyRecipientsFrom(promotedItem.CoreItem.Recipients);
 }