public T Peek() { if (Count == 0) { throw new Exception("No item to dequeue."); } T item = UnderlyingList.First(); return(item); }
public T Dequeue() { if (!UnderlyingList.Any()) { throw new Exception("Nothing to dequeue."); } T item = UnderlyingList.First(); UnderlyingList.RemoveAtIndex(0); return(item); }