Пример #1
0
        public T RemoveFirst()
        {
            if (Count == 0)
            {
                throw new InvalidOperationException("The list is empty");
            }

            var currentValue = first.Value;

            if (first == last)
            {
                first = null;
                last  = null;
            }
            else
            {
                first      = first.Next;
                first.Prev = null;
            }

            Count--;
            return(currentValue);
        }
Пример #2
0
 public LinkedListEnumerator(LinkedListItem <T> first)
 {
     this.first = first;
 }