An ability to read some current items will be useful too.
authorCryptoManiac <balthazar@yandex.ru>
Thu, 20 Aug 2015 17:24:54 +0000 (20:24 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Thu, 20 Aug 2015 17:24:54 +0000 (20:24 +0300)
Novacoin/WrappedList.cs

index 79068c3..28a79a0 100644 (file)
@@ -50,6 +50,11 @@ namespace Novacoin
             return Elements[Index++];
         }
 
+        public T GetCurrentItem()
+        {
+            return Elements[Index];
+        }
+
         public T[] GetItems(int Count)
         {
             if (Elements.Count - Index < Count)
@@ -63,6 +68,18 @@ namespace Novacoin
             return result;
         }
 
+        public T[] GetCurrentItems(int Count)
+        {
+            if (Elements.Count - Index < Count)
+            {
+                throw new WrappedListException("Unable to read requested amount of data.");
+            }
+
+            T[] result = Elements.Skip<T>(Index).Take<T>(Count).ToArray<T>();
+
+            return result;
+        }
+
         public IEnumerable<T> GetEnumerableItems(int Count)
         {
             if (Elements.Count - Index < Count)