Exemplo n.º 1
0
        // Token: 0x060001ED RID: 493 RVA: 0x00007844 File Offset: 0x00005A44
        private static IEnumerable <StoreObjectId> ProcessQueryRows(PropertyDefinition[] propertyDefinitions, IQueryResult itemQueryResult, AnchorRowSelector rowSelectorPredicate, int idColumnIndex, int?maxCount)
        {
            Dictionary <PropertyDefinition, object> rowData = new Dictionary <PropertyDefinition, object>(propertyDefinitions.Length);
            int  matchingRowCount = 0;
            bool mightBeMoreRows  = true;

            while (mightBeMoreRows)
            {
                object[][] rows = itemQueryResult.GetRows(100, out mightBeMoreRows);
                if (!mightBeMoreRows)
                {
                    break;
                }
                foreach (object[] row in rows)
                {
                    rowData.Clear();
                    for (int j = 0; j < propertyDefinitions.Length; j++)
                    {
                        rowData[propertyDefinitions[j]] = row[j];
                    }
                    switch (rowSelectorPredicate(rowData))
                    {
                    case AnchorRowSelectorResult.AcceptRow:
                        matchingRowCount++;
                        yield return(((VersionedId)row[idColumnIndex]).ObjectId);

                        if (maxCount != null && matchingRowCount == maxCount)
                        {
                            mightBeMoreRows = false;
                        }
                        break;

                    case AnchorRowSelectorResult.RejectRowContinueProcessing:
                        break;

                    case AnchorRowSelectorResult.RejectRowStopProcessing:
                        mightBeMoreRows = false;
                        break;

                    default:
                        mightBeMoreRows = false;
                        break;
                    }
                    if (!mightBeMoreRows)
                    {
                        break;
                    }
                }
            }
            yield break;
        }
Exemplo n.º 2
0
 // Token: 0x060001E4 RID: 484 RVA: 0x000072C0 File Offset: 0x000054C0
 public IEnumerable <StoreObjectId> FindMessageIds(QueryFilter queryFilter, PropertyDefinition[] properties, SortBy[] sortBy, AnchorRowSelector rowSelector, int?maxCount)
 {
     AnchorUtil.ThrowOnCollectionEmptyArgument(sortBy, "sortBy");
     if (maxCount == null || maxCount.Value > 0)
     {
         if (properties == null)
         {
             properties = new PropertyDefinition[0];
         }
         PropertyDefinition[] columns = new PropertyDefinition[1 + properties.Length];
         columns[0] = ItemSchema.Id;
         Array.Copy(properties, 0, columns, 1, properties.Length);
         using (IQueryResult itemQueryResult = this.folder.Folder.IItemQuery(ItemQueryType.Associated, queryFilter, sortBy, columns))
         {
             foreach (StoreObjectId id in AnchorDataProvider.ProcessQueryRows(columns, itemQueryResult, rowSelector, 0, maxCount))
             {
                 yield return(id);
             }
         }
     }
     yield break;
 }