public bool MoveNext() { if (i >= MAXRESULTS) { return(false); } int pos = current.IndexPos; do { pos = database.NextRecordPos(pos); //if (pos < 0) { i = MAXRESULTS; return false; } int minnext = int.MaxValue; for (int cnt = 0; cnt < terms.Length; cnt++) { // find the first record that contains at least one of the terms if (termpos[cnt] >= 0 && termpos[cnt] < pos) { termpos[cnt] = database.NextHit(pos, terms[cnt]); } if (termpos[cnt] > 0) { if (termpos[cnt] < minnext) { minnext = termpos[cnt]; } } } if (minnext == int.MaxValue) { i = MAXRESULTS; return(false); } pos = minnext; current = database.RecordFromPos(pos); bool isPremiumMatch = (includePremium || current.Meal != "P"); if (isPremiumMatch && searchWorker.IsMatch(current.Name)) { i++; return(true); } } while (pos > 0); i = MAXRESULTS; return(false); }
public bool MoveNext() { do { pos = database.NextRecordPos(pos); if (pos <= 0) { return(false); } current = database.ItemFromResourceRecord(database.RecordFromPos(pos)); if (current == null) { return(false); } if (current.CommonMeal == null || current.CommonMeal == "P") { return(false); // done after common items are finished } } while (current.Text == null || (Meal != null && current.CommonMeal != Meal && current.CommonMeal != "P")); // itterate untill we have a match return(true); }