/// <summary> /// Move to the next items. /// </summary> /// <returns><c>true</c> if there is a next item, <c>false</c> otherwise</returns> public override bool MoveNext() { PageFetcher <T> .Page <T> page = GetCurrentPage(); if (page == null) { return(false); } IList <T> items = page.Items; if (items == null || items.Count == 0) { return(false); } if (SkipOffset == items.Count) { if (!HasMoreItems) { return(false); } page = IncrementPage(); items = page?.Items; } if (items == null || items.Count == 0 || SkipOffset == items.Count) { return(false); } current = items[IncrementSkipOffset()]; return(true); }
/// <summary> /// Constructor. /// </summary> /// <param name="skipCount">the skip count</param> /// <param name="pageFetcher">the delegate that fetches a page</param> protected AbstractEnumerator(BigInteger skipCount, PageFetcher <T> pageFetcher) { this.SkipCount = skipCount; this.pageFetcher = pageFetcher; }
/// <summary> /// Constructor. /// </summary> /// <param name="position">the skip count</param> /// <param name="pageFetcher">>the delegate that fetches a page</param> protected AbstractEnumerable(BigInteger position, PageFetcher <T> pageFetcher) { this.PageFetcher = pageFetcher; this.SkipCount = position; }
/// <summary> /// Constructor. /// </summary> /// <param name="pageFetcher">>the delegate that fetches a page</param> public AbstractEnumerable(PageFetcher <T> pageFetcher) : this(0, pageFetcher) { }
/// <summary> /// Constructor. /// </summary> /// <param name="skipCount">the skip count</param> /// <param name="pageFetcher">the delegate that fetches a page</param> public CollectionPageEnumerator(BigInteger skipCount, PageFetcher <T> pageFetcher) : base(skipCount, pageFetcher) { }
/// <summary> /// Constructor. /// </summary> /// <param name="position">the position</param> /// <param name="pageFetcher">the delegate that fetches a page</param> public CollectionPageEnumerable(BigInteger position, PageFetcher <T> pageFetcher) : base(position, pageFetcher) { }
/// <summary> /// Constructor. /// </summary> /// <param name="pageFetcher">the delegate that fetches a page</param> public CollectionPageEnumerable(PageFetcher <T> pageFetcher) : this(0, pageFetcher) { }