Beispiel #1
0
 /// <summary>Initializes a slice.</summary>
 /// <exception cref="ArgumentException">The start index was below zero.</exception>
 /// <remarks>The (start, count) range is allowed to be invalid, as long
 /// as 'start' and 'count' are zero or above.
 /// <ul>
 /// <li>If 'start' is above the original Count, the Count of the new slice
 /// is set to zero.</li>
 /// <li>if (start + count) is above the original Count, the Count of the new
 /// slice is reduced to <c>list.Count - start</c>.</li>
 /// </ul>
 /// </remarks>
 public ROLSlice(TList list, int start, int count = int.MaxValue)
 {
     _list  = list;
     _start = start;
     _count = count;
     _count = CheckParam.ThrowIfStartOrCountAreBelowZeroAndLimitCountIfNecessary(start, count, list.Count);
 }
Beispiel #2
0
        public SparseListSourceSlice <T, TList> Slice(int start, int count = int.MaxValue)
        {
            var slice = new SparseListSourceSlice <T, TList>();

            slice._list  = this._list;
            slice._start = this._start + start;
            slice._count = CheckParam.ThrowIfStartOrCountAreBelowZeroAndLimitCountIfNecessary(start, count, this._count);
            return(slice);
        }
Beispiel #3
0
 /// <summary>Initializes a slice.</summary>
 /// <exception cref="ArgumentException">The start index was below zero.</exception>
 /// <remarks>The (start, count) range is allowed to be invalid, as long
 /// as 'start' and 'count' are zero or above.
 /// <ul>
 /// <li>If 'start' is above the original Count, the Count of the new slice
 /// is set to zero.</li>
 /// <li>if (start + count) is above the original Count, the Count of the new
 /// slice is reduced to <c>list.Count - start</c>.</li>
 /// </ul>
 /// </remarks>
 public Slice_(IListSource <T> list, int start, int count = int.MaxValue)
 {
     _list  = list;
     _start = start;
     _count = CheckParam.ThrowIfStartOrCountAreBelowZeroAndLimitCountIfNecessary(start, count, _list.Count);
 }