Exemplo n.º 1
0
 public T this[int index]
 {
     get
     {
         if (index < 0 || index >= Count)
         {
             throw new IndexOutOfRangeException();
         }
         var decomposed = IndexHelper.Decompose(index, _maxEntriesPartSize);
         return(_entriesParts[decomposed.Item1][decomposed.Item2]);
     }
 }
Exemplo n.º 2
0
 public T this[int index]
 {
     get
     {
         var decomposed = IndexHelper.Decompose(index, _maxEntriesPartSize);
         if (decomposed.Item1 >= _partCursor - 1 && decomposed.Item2 >= _entryCursor)
         {
             throw new IndexOutOfRangeException();
         }
         return(_entriesParts[decomposed.Item1][decomposed.Item2]);
     }
     set
     {
         var decomposed = IndexHelper.Decompose(index, _maxEntriesPartSize);
         if (decomposed.Item1 >= _partCursor - 1 && decomposed.Item2 >= _entryCursor)
         {
             throw new IndexOutOfRangeException();
         }
         _entriesParts[decomposed.Item1][decomposed.Item2] = value;
     }
 }