public Inbox(int size, Inbox existingInbox) { _size = size; _emails = new FixedSizeAndReversedOrderQueue <Email>(_size, existingInbox._emails); while (_emails.Count > _size) { _emails.Dequeue(); } }
public FixedSizeAndReversedOrderQueue(int size, FixedSizeAndReversedOrderQueue <T> existingQueue) { _size = size; _items = new List <T>(existingQueue._items); if (_items.Count > _size) { _items.RemoveRange(_size, _items.Count - _size); } }
private Inbox() { _emails = new FixedSizeAndReversedOrderQueue <Email>(0); }