Ejemplo n.º 1
0
 private static void ValidateAdditionalProperties(ICollection <PropertyDefinition> additionalProperties)
 {
     if (additionalProperties == null || additionalProperties.Count == 0)
     {
         return;
     }
     foreach (PropertyDefinition propertyDefinition in additionalProperties)
     {
         if (!RecurrenceManager.CanPropertyBeInExceptionData(propertyDefinition) && !RecurrenceManager.MasterOnlyProperties.Contains(propertyDefinition))
         {
             throw new ArgumentException(string.Format("[CalendarCorrelationMatch.ValidateAdditionalProperties] Property '{0}' cannot be requested because it is not in the O11 blob properties nor master property list", propertyDefinition.Name));
         }
     }
 }
Ejemplo n.º 2
0
 private void PopulateExceptionOccurrence(object[] occurrence, PropertyDefinition[] columns, ExceptionInfo exception, ref AttachmentCollection attachments, ref Item master, VersionedId versionedId)
 {
     object[] array = null;
     for (int i = 0; i < columns.Length; i++)
     {
         if (!columns[i].Equals(InternalSchema.ItemId) && !columns[i].Equals(InternalSchema.IsRecurring) && !columns[i].Equals(InternalSchema.IsException) && !columns[i].Equals(InternalSchema.AppointmentRecurring) && !columns[i].Equals(InternalSchema.MapiStartTime) && !columns[i].Equals(InternalSchema.MapiPRStartDate) && !columns[i].Equals(InternalSchema.MapiEndTime) && !columns[i].Equals(InternalSchema.MapiPREndDate) && !columns[i].Equals(InternalSchema.CalendarItemType) && !columns[i].Equals(InternalSchema.GlobalObjectId) && !columns[i].Equals(InternalSchema.TimeZoneDefinitionStart) && !columns[i].Equals(InternalSchema.TimeZoneDefinitionEnd) && !columns[i].Equals(InternalSchema.Codepage) && !RecurrenceManager.MasterOnlyProperties.Contains(columns[i]))
         {
             if (RecurrenceManager.CanPropertyBeInExceptionData(columns[i]))
             {
                 object        obj           = exception.PropertyBag.TryGetProperty(columns[i]);
                 PropertyError propertyError = obj as PropertyError;
                 if (propertyError != null)
                 {
                     if (propertyError.PropertyErrorCode != PropertyErrorCode.NotFound)
                     {
                         throw PropertyError.ToException(new PropertyError[]
                         {
                             propertyError
                         });
                     }
                 }
                 else
                 {
                     occurrence[i] = obj;
                 }
             }
             else
             {
                 ExTraceGlobals.RecurrenceTracer.Information <PropertyDefinition>((long)this.recurrence.GetHashCode(), "RecurrenceManager::Expand, Opening embedded message for {0} property", columns[i]);
                 if (array == null)
                 {
                     if (attachments == null)
                     {
                         if (master == null)
                         {
                             ExTraceGlobals.RecurrenceTracer.Information((long)this.recurrence.GetHashCode(), "RecurrenceManager::Expand. Fetching master message when constructing view");
                             StoreObjectId masterId = versionedId.ObjectId;
                             bool          flag     = false;
                             try
                             {
                                 master = ItemBuilder.ConstructItem <Item>(this.storeSession, masterId, null, CalendarItemBaseSchema.Instance.AutoloadProperties, () => new StoreObjectPropertyBag(this.storeSession, this.storeSession.GetMapiProp(masterId), CalendarItemBaseSchema.Instance.AutoloadProperties), ItemCreateInfo.GenericItemInfo.Creator, Origin.Existing, ItemLevel.TopLevel);
                                 flag   = true;
                             }
                             finally
                             {
                                 if (!flag && master != null)
                                 {
                                     master.Dispose();
                                     master = null;
                                 }
                             }
                         }
                         attachments = master.AttachmentCollection;
                         ExTraceGlobals.RecurrenceTracer.Information((long)this.recurrence.GetHashCode(), "RecurrenceManager::Expand, Fetching attachments");
                     }
                     ItemAttachment itemAttachment = null;
                     using (Item item = RecurrenceManager.OpenEmbeddedMessageAndAttachment(attachments, TimeZoneHelper.GetRecurringTimeZoneFromPropertyBag(attachments.ContainerItem.PropertyBag), exception.StartTime, exception.EndTime, out itemAttachment, columns))
                     {
                         ExTraceGlobals.RecurrenceTracer.Information <ExDateTime>((long)this.recurrence.GetHashCode(), "RecurrenceManager::Expand, Fetching Embedded Message for exception occurence dateId: {0}", exception.OccurrenceDateId);
                         if (item != null)
                         {
                             array = item.GetProperties(columns);
                             itemAttachment.Dispose();
                         }
                         else
                         {
                             array = new object[columns.Length];
                         }
                     }
                 }
                 if (array[i] != null && !(array[i] is PropertyError))
                 {
                     occurrence[i] = array[i];
                 }
             }
         }
     }
 }