Ejemplo n.º 1
0
        public void CopyTo(T[] array, int arrayIndex)
        {
            if (array == null)
            {
                throw new ArgumentNullException(nameof(array));
            }

            if (array.GetLowerBound(0) != 0)
            {
                throw new ArgumentException("Non zero lower bound");
            }

            if (arrayIndex < 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            if (array.Length - arrayIndex < Count)
            {
                throw new ArgumentException();
            }

            var items = TraversalStrategy.Traversal(Head);

            while (items.MoveNext())
            {
                array[arrayIndex++] = items.Current;
            }
        }
Ejemplo n.º 2
0
 public IEnumerator <T> GetEnumerator()
 {
     return(TraversalStrategy.Traversal(Head));
 }