示例#1
0
        //
        // Summary:
        //     Creates a shallow copy of a range of elements in the source System.Collections.Generic.List`1.
        //
        // Parameters:
        //   index:
        //     The zero-based System.Collections.Generic.List`1 index at which the range starts.
        //
        //   count:
        //     The number of elements in the range.
        //
        // Returns:
        //     A shallow copy of a range of elements in the source System.Collections.Generic.List`1.
        //
        // Exceptions:
        //   T:System.ArgumentOutOfRangeException:
        //     index is less than 0. -or- count is less than 0.
        //
        //   T:System.ArgumentException:
        //     index and count do not denote a valid range of elements in the System.Collections.Generic.List`1.
        public ListByte GetRange(int index, int count)
        {
            var list = new ListByte();

            for (int i = index; i < count; i++)
            {
                list.Add((byte)_list[i]);
            }

            return(list);
        }
示例#2
0
 public Enumerator(ListByte collection)
 {
     _index      = 0;
     _collection = collection;
 }