Exemple #1
0
        public IEnumerator GetEnumerator()
        {
            string           href = GetURI();
            ResourcePage <T> page = new ResourcePage <T>(href);

            iterator = new ResourceIterator(href, page);
            return(iterator);
        }
Exemple #2
0
        public List <T> All()
        {
            string           href     = GetURI();
            ResourcePage <T> page     = new ResourcePage <T>(href);
            List <T>         items    = new List <T>(page.GetTotal());
            ResourceIterator iterator = new ResourceIterator(href, page);

            while (iterator.MoveNext())
            {
                object obj = iterator.Current;
                items.Add((T)obj);
            }
            return(items);
        }
Exemple #3
0
        /// <summary>
        /// The get enumerator.
        /// </summary>
        /// <returns>The <see cref="IEnumerator" />.</returns>
        public IEnumerator <T> GetEnumerator()
        {
            var current = new ResourcePage <T>(this.uri);

            while (current != null)
            {
                foreach (var i in current.items)
                {
                    yield return(i);
                }

                current = current.Next;
            }
        }
Exemple #4
0
 public ResourceIterator(String pHref, ResourcePage <T> pPage)
 {
     href  = pHref;
     page  = pPage;
     index = 0;
 }