protected bool AdvanceLeadUntilAllAligned() { var doc = Lead.Current; for (int index = 1; index < Enumerators.Count; ++index) { if (Enumerators[index].Current < doc) { Enumerators[index].Advance(doc); if (Enumerators[index].Current > doc) { if (!Lead.Advance(Enumerators[index].Current)) { return(false); } doc = Lead.Current; index = 0; // 0 Because it will be incremented next loop to 1 } } } return(true); }
public bool Advance(int target) { return(Lead.Advance(target) && AdvanceLeadUntilAllAligned()); }