/// <inheritdoc /> public override void Add(KeyValuePair <TKey, TValue> item) { ICollectionContracts.Add(this); if (this.addValue(item)) { this.Dictionary.Add(item); } }
/// <inheritdoc /> public void CopyTo(KeyValuePair <TIndex, TValue>[] array, int arrayIndex) { ICollectionContracts.CopyTo(this, array, arrayIndex); foreach (KeyValuePair <TIndex, TValue> entry in this) { array[arrayIndex] = entry; arrayIndex++; } }
/// <inheritdoc /> public void Clear() { ICollectionContracts.Clear(this); foreach (var entry in this.indexable) { this.indexable[entry.Key] = TryValue.None <TValue>(); } this.count = 0; }
/// <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); }
/// <inheritdoc /> public void Add(T item) { ICollectionContracts.Add(this); int count; if (this.countPerItem.TryGetValue(item, out count)) { this.countPerItem[item] = count + 1; } else { this.countPerItem[item] = 1; } }
/// <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 void CopyTo(T[] array, int arrayIndex) { ICollectionContracts.CopyTo(this, array, arrayIndex); this.countPerItem.Keys.CopyTo(array, arrayIndex); }
/// <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)); }
/// <inheritdoc /> public void CopyTo(TBase[] array, int arrayIndex) { ICollectionContracts.CopyTo(this, array, arrayIndex); this.values.Values.CopyTo(array, arrayIndex); }
/// <inheritdoc /> public void CopyTo(KeyValuePair <Type, TBase>[] array, int arrayIndex) { ICollectionContracts.CopyTo(this, array, arrayIndex); this.values.CopyTo(array, arrayIndex); }
/// <inheritdoc /> void ICollection <IDisposable> .Add(IDisposable item) { ICollectionContracts.Add(this); this.Add(item); }
/// <inheritdoc /> public void Add(KeyValuePair <TIndex, TValue> item) { ICollectionContracts.Add(this); this.dictionary.Add(item); }
/// <inheritdoc /> public void Clear() { ICollectionContracts.Clear(this); this.countPerItem.Clear(); }
/// <inheritdoc /> public bool Remove(T item) { ICollectionContracts.Remove(this); return(this.instances.Remove(item)); }
/// <inheritdoc /> public void Add(KeyValuePair <TIndex, TValue> item) { ICollectionContracts.Add(this); this.Add(item.Key, item.Value); }
/// <inheritdoc /> public void CopyTo(T[] array, int arrayIndex) { ICollectionContracts.CopyTo(this, array, arrayIndex); this.instances.Keys.CopyTo(array, arrayIndex); }
/// <inheritdoc /> public void Clear() { ICollectionContracts.Clear(this); this.instances.Clear(); }
/// <inheritdoc /> void ICollection <T> .Add(T item) { ICollectionContracts.Add(this); this.Add(item); }
/// <inheritdoc /> public void CopyTo(IDisposable[] array, int arrayIndex) { ICollectionContracts.CopyTo(this, array, arrayIndex); this.disposables.CopyTo(array, arrayIndex); }
/// <inheritdoc /> public void Clear() { ICollectionContracts.Clear(this); this.disposables.Clear(); }
/// <inheritdoc /> public void Clear() { ICollectionContracts.Clear(this); this.dictionary.Clear(); }
/// <inheritdoc /> public virtual void Add(KeyValuePair <TKey, TValue> item) { ICollectionContracts.Add(this); this.Dictionary.Add(item); }
/// <inheritdoc /> public virtual bool Remove(KeyValuePair <TKey, TValue> item) { ICollectionContracts.Remove(this); return(this.Dictionary.Remove(item)); }
/// <inheritdoc /> public void Clear() { ICollectionContracts.Clear <KeyValuePair <Type, TBase> >(this); this.values.Clear(); }
/// <inheritdoc /> public bool Remove(KeyValuePair <TIndex, TValue> item) { ICollectionContracts.Remove(this); return(this.dictionary.Remove(item)); }
/// <inheritdoc /> public bool Remove(IDisposable item) { ICollectionContracts.Remove(this); return(this.disposables.Remove(item)); }
/// <inheritdoc /> public void CopyTo(KeyValuePair <TIndex, TValue>[] array, int arrayIndex) { ICollectionContracts.CopyTo(this, array, arrayIndex); this.dictionary.CopyTo(array, arrayIndex); }
/// <inheritdoc /> public virtual void Clear() { ICollectionContracts.Clear(this); this.Dictionary.Clear(); }