/// <inheritdoc />
        public bool Remove(KeyValuePair <TIndex, TValue> item)
        {
            ICollectionContracts.Remove(this);

            if (!this.Contains(item))
            {
                return(false);
            }

            this.indexable[item.Key] = TryValue.None <TValue>();
            this.count--;
            return(true);
        }
Beispiel #2
0
        /// <inheritdoc />
        public bool Remove(T item)
        {
            ICollectionContracts.Remove(this);

            int count;

            if (this.countPerItem.TryGetValue(item, out count))
            {
                if (count > 1)
                {
                    this.countPerItem[item] = count - 1;
                }
                else
                {
                    this.countPerItem.Remove(item);
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <inheritdoc />
        public bool Remove(KeyValuePair <TIndex, TValue> item)
        {
            ICollectionContracts.Remove(this);

            return(this.dictionary.Remove(item));
        }
        /// <inheritdoc />
        public bool Remove(TBase item)
        {
            ICollectionContracts.Remove <TBase>(this);

            return(this.values.Remove(new KeyValuePair <Type, TBase>(item?.GetType(), item)));
        }
        /// <inheritdoc />
        public bool Remove(Type key)
        {
            ICollectionContracts.Remove <KeyValuePair <Type, TBase> >(this);

            return(this.values.Remove(key));
        }
Beispiel #6
0
        /// <inheritdoc />
        public bool Remove(T item)
        {
            ICollectionContracts.Remove(this);

            return(this.instances.Remove(item));
        }
Beispiel #7
0
        /// <inheritdoc />
        public bool Remove(IDisposable item)
        {
            ICollectionContracts.Remove(this);

            return(this.disposables.Remove(item));
        }
        /// <inheritdoc />
        public virtual bool Remove(KeyValuePair <TKey, TValue> item)
        {
            ICollectionContracts.Remove(this);

            return(this.Dictionary.Remove(item));
        }