private IEnumerable <VersionedId> ReadMessageIdsFromQueryResult(QueryResult queryResult, ExDateTime cutoffDateTime, bool latest) { object[][] rows = queryResult.GetRows(1000); foreach (object[] row in rows) { VersionedId messageId = PropertyBag.CheckPropertyValue <VersionedId>(ItemSchema.Id, row[0]); ExDateTime createTime = PropertyBag.CheckPropertyValue <ExDateTime>(StoreObjectSchema.CreationTime, row[1]); if ((latest && createTime > cutoffDateTime) || (!latest && createTime <= cutoffDateTime)) { yield return(messageId); } } yield break; }
internal void LoadDataFromXsoRows(ADObjectId mailboxOwnerId, object[] objectRow, PropertyDefinition[] xsoPropertyDefinitions) { if (mailboxOwnerId == null) { throw new ArgumentNullException("mailboxOwnerId"); } if (objectRow == null) { throw new ArgumentNullException("objectRow"); } if (xsoPropertyDefinitions == null) { throw new ArgumentNullException("xsoPropertyDefinitions"); } if (objectRow.Length != xsoPropertyDefinitions.Length) { throw new ArgumentException("xsoPropertyDefinitions and objectRow length mismatch"); } base.InstantiationErrors.Clear(); this.MailboxOwnerId = mailboxOwnerId; for (int i = 0; i < xsoPropertyDefinitions.Length; i++) { XsoDriverPropertyDefinition relatedWrapperProperty = this.Schema.GetRelatedWrapperProperty(xsoPropertyDefinitions[i]); try { object obj = objectRow[i]; StorePropertyDefinition propertyDefinition = InternalSchema.ToStorePropertyDefinition(xsoPropertyDefinitions[i]); if (obj != null) { this.propertyBag.SetField(relatedWrapperProperty, PropertyBag.CheckPropertyValue <object>(propertyDefinition, obj, null)); } } catch (StoragePermanentException ex) { base.InstantiationErrors.Add(new PropertyValidationError(ex.LocalizedString, relatedWrapperProperty, null)); } } }