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); }
public LinkedListEnumerator(LinkedListItem <T> first) { this.first = first; }