Esempio n. 1
0
        public void Push(MruItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            if (string.IsNullOrEmpty(item.FileName))
            {
                throw new ArgumentException("Incomplete MRU list item data.", "item");
            }

            Push(item, false);
        }
Esempio n. 2
0
        public void Push(MruItem item, bool suppressChangedEvent)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            if (string.IsNullOrEmpty(item.FileName))
            {
                throw new ArgumentException("Incomplete MRU list item data.", "item");
            }

            items.Enqueue(item);
            if (items.Count > maxItems)
            {
                items.Dequeue();
            }

            if (!suppressChangedEvent)
            {
                OnChanged();
            }
        }