예제 #1
0
        /// <summary>
        /// Fetches the requested page from the IItemsProvider.
        /// </summary>
        /// <param name="pageIndex">Index of the page.</param>
        /// <returns></returns>
        protected IList <T> FetchPage(int pageIndex, int pageLength, out int count)
        {
            var result = ItemsProvider.FetchRange(pageIndex * PageSize, pageLength, out count);

            Debug.Assert(result.Count <= pageLength, string.Format("Requested {0} got {1}", pageLength, result.Count));
            Debug.Assert(count >= result.Count, "Sanity check");
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Fetches the requested page from the IItemsProvider.
        /// </summary>
        /// <param name="pageIndex">Index of the page.</param>
        /// <returns></returns>
        protected IList <T> FetchPage(int pageIndex)
        {
            if (pageIndex * PageSize + PageSize <= _count)
            {
                return(ItemsProvider.FetchRange(pageIndex * PageSize, PageSize));
            }

            return(ItemsProvider.FetchRange(pageIndex * PageSize, (_count - pageIndex * PageSize)));
        }
예제 #3
0
 /// <summary>
 /// Fetches the requested page from the IItemsProvider.
 /// </summary>
 /// <param name="pageIndex">Index of the page.</param>
 /// <returns></returns>
 protected IList <T> FetchPage(int pageIndex)
 {
     return(ItemsProvider.FetchRange(pageIndex * PageSize, PageSize));
 }
예제 #4
0
 /// <summary>
 /// Fetches the requested page from the IItemsProvider.
 /// </summary>
 /// <param name="pageIndex">Index of the page.</param>
 /// <returns></returns>
 protected async Task <IList <T> > FetchPage(int pageIndex)
 {
     return(await ItemsProvider.FetchRange(pageIndex *PageSize, PageSize));
 }
 protected IList <T> FetchRange(int startIndex, int count)
 {
     return(ItemsProvider.FetchRange(startIndex, count));
 }
예제 #6
0
 /// <summary>
 /// Fetches the requested page from the IItemsProvider.
 /// </summary>
 /// <param name="pageIndex">Index of the page.</param>
 /// <returns></returns>
 protected IList <T> FetchPage(int pageIndex)
 {
     //Trace.WriteLine("ВОЗВРАТ СТРАНИЦЫ:  pageIndex=" + pageIndex);
     return(ItemsProvider.FetchRange(pageIndex * PageSize, PageSize));
 }
예제 #7
0
 /// <summary>
 /// Not supported.
 /// </summary>
 /// <param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:System.Collections.Generic.ICollection`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
 /// <param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
 /// <exception cref="T:System.ArgumentNullException">
 ///     <paramref name="array"/> is null.
 /// </exception>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 ///     <paramref name="arrayIndex"/> is less than 0.
 /// </exception>
 /// <exception cref="T:System.ArgumentException">
 ///     <paramref name="array"/> is multidimensional.
 /// -or-
 /// <paramref name="arrayIndex"/> is equal to or greater than the length of <paramref name="array"/>.
 /// -or-
 /// The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1"/> is greater than the available space from <paramref name="arrayIndex"/> to the end of the destination <paramref name="array"/>.
 /// -or-
 /// Type <paramref name="T"/> cannot be cast automatically to the type of the destination <paramref name="array"/>.
 /// </exception>
 public void CopyTo(T[] array, int arrayIndex)
 {
     ItemsProvider.FetchRange(arrayIndex, array.Length).CopyTo(array, arrayIndex);
 }
예제 #8
0
 /// <summary>
 /// Not supported.
 /// </summary>
 /// <param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:System.Collections.Generic.ICollection`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
 /// <param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
 /// <exception cref="T:System.ArgumentNullException">
 ///     <paramref name="array"/> is null.
 /// </exception>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 ///     <paramref name="arrayIndex"/> is less than 0.
 /// </exception>
 /// <exception cref="T:System.ArgumentException">
 ///     <paramref name="array"/> is multidimensional.
 /// -or-
 /// <paramref name="arrayIndex"/> is equal to or greater than the length of <paramref name="array"/>.
 /// -or-
 /// The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1"/> is greater than the available space from <paramref name="arrayIndex"/> to the end of the destination <paramref name="array"/>.
 /// -or-
 /// Type <see cref="T"/> cannot be cast automatically to the type of the destination <paramref name="array"/>.
 /// </exception>
 public void CopyTo(T[] array, int arrayIndex)
 {
     ItemsProvider.FetchRange(0, Count).CopyTo(array);
 }
 /// <summary>
 /// Fetches the requested page from the IItemsProvider.
 /// </summary>
 /// <param name="pageIndex">Index of the page.</param>
 /// <returns></returns>
 protected IList <T> FetchPage(int pageIndex, int pageLength, out int count)
 {
     return(ItemsProvider.FetchRange(pageIndex * PageSize, pageLength, out count));
 }