private IEnumerable <ParadoxRecord> Enumerate(ParadoxCondition condition, ushort blockId, int indexLevel) { if (indexLevel == 0) { var block = this.table.GetBlock(blockId); for (int i = 0; i < block.RecordCount; i++) { var rec = block[i]; if (condition.IsDataOk(rec)) { yield return(rec); } } } else { var block = this.GetBlock(blockId); var blockIdFldIndex = this.FieldCount - 3; for (int i = 0; i < block.RecordCount; i++) { var rec = block[i]; if (condition.IsIndexPossible(rec, i < block.RecordCount - 1 ? block[i + 1] : null)) { var qry = Enumerate(condition, (ushort)((short)rec.DataValues[blockIdFldIndex] - 1), indexLevel - 1); foreach (var dataRec in qry) { yield return(dataRec); } } } } }
public IEnumerable <ParadoxRecord> Enumerate(ParadoxCondition condition) { return(Enumerate(condition, (ushort)(this.pxRootBlockId - 1), this.pxLevelCount)); }