private static List <RecurrenceManager.ExceptionSummary> GetExceptionSumaryList(AttachmentCollection attachments)
        {
            List <RecurrenceManager.ExceptionSummary> list = new List <RecurrenceManager.ExceptionSummary>(attachments.Count);

            foreach (AttachmentHandle handle in attachments.GetAllHandles())
            {
                if (CoreAttachmentCollection.IsCalendarException(handle))
                {
                    using (Attachment attachment = attachments.Open(handle, null))
                    {
                        ExDateTime?valueAsNullable = attachment.GetValueAsNullable <ExDateTime>(InternalSchema.AppointmentExceptionStartTime);
                        if (valueAsNullable != null)
                        {
                            ExDateTime?valueAsNullable2 = attachment.GetValueAsNullable <ExDateTime>(InternalSchema.AppointmentExceptionEndTime);
                            if (valueAsNullable2 != null)
                            {
                                ExDateTime utcStart = ExTimeZone.UtcTimeZone.ConvertDateTime(valueAsNullable.Value);
                                ExDateTime utcEnd   = ExTimeZone.UtcTimeZone.ConvertDateTime(valueAsNullable2.Value);
                                list.Add(new RecurrenceManager.ExceptionSummary(handle, utcStart, utcEnd));
                            }
                        }
                    }
                }
            }
            return(list);
        }
 public bool MoveNext()
 {
     while (this.list.MoveNext())
     {
         AttachmentHandle handle = this.list.Current;
         if (!CoreAttachmentCollection.IsCalendarException(handle))
         {
             return(true);
         }
     }
     return(false);
 }
 public IList <AttachmentHandle> GetHandles()
 {
     if (this.hideCalendarExceptions)
     {
         List <AttachmentHandle> list = new List <AttachmentHandle>(this.CoreAttachmentCollection.Count);
         foreach (AttachmentHandle attachmentHandle in this.CoreAttachmentCollection)
         {
             if (!CoreAttachmentCollection.IsCalendarException(attachmentHandle))
             {
                 list.Add(attachmentHandle);
             }
         }
         return(list);
     }
     return(this.GetAllHandles());
 }
Example #4
0
        private AttachmentPropertyBag.SavedData ComputeSavedData()
        {
            AttachmentPropertyBag.SavedData savedData = new AttachmentPropertyBag.SavedData();
            savedData.AttachmentId = this.AttachmentId;
            savedData.AttachMethod = this.AttachMethod;
            StringBuilder stringBuilder = new StringBuilder();

            this.ComputeCharsetDetectionData(stringBuilder);
            savedData.CharsetDetectionString = stringBuilder.ToString();
            int?num = ((IDirectPropertyBag)this.CurrentPropertyBag).GetValue(InternalSchema.AttachCalendarFlags) as int?;

            savedData.IsCalendarException = CoreAttachmentCollection.IsCalendarException((num != null) ? num.Value : 0);
            bool?flag = base.TryGetProperty(InternalSchema.AttachmentIsInline) as bool?;

            savedData.IsInline = (flag != null && flag.Value);
            return(savedData);
        }