Simplification of syntax
[NovacoinLibrary.git] / Novacoin / WrappedList.cs
index 79068c3..89c5cce 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)
@@ -57,12 +62,24 @@ namespace Novacoin
                 throw new WrappedListException("Unable to read requested amount of data.");
             }
 
-            T[] result = Elements.Skip<T>(Index).Take<T>(Count).ToArray<T>();
+            T[] result = Elements.Skip(Index).Take(Count).ToArray();
             Index += Count;
 
             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(Index).Take(Count).ToArray();
+
+            return result;
+        }
+
         public IEnumerable<T> GetEnumerableItems(int Count)
         {
             if (Elements.Count - Index < Count)
@@ -70,7 +87,7 @@ namespace Novacoin
                 throw new WrappedListException("Unable to read requested amount of data.");
             }
 
-            IEnumerable<T> result = Elements.Skip<T>(Index).Take<T>(Count);
+            IEnumerable<T> result = Elements.Skip(Index).Take(Count);
             Index += Count;
 
             return result;