// Copyright © 2017-2018 Atomic Software, LLC. All Rights Reserved. // See LICENSE.md for full license information. namespace Atom.Core.Collections { public class Dictionary : System.Collections.Generic.Dictionary { public new int Count { get; private set; } public new void Add(TKey key, TValue value) { base.Add(key, value); Count++; } public new bool Remove(TKey key) { if (!base.Remove(key)) { return false; } Count--; return true; } public new TValue this[TKey index] { get => !ContainsKey(index) ? default(TValue) : base[index]; set { if (!ContainsKey(index)) { return; } base[index] = value; } } public new void Clear() { base.Clear(); Count = 0; } } }