Example #1
0
        public bool Remove(TK key)
        {
            if (!myStorage.TryGetValue(key, out var value))
            {
                return(false);
            }
            myStorage.Remove(key);

            myChange.Fire(MapEvent <TK, TV> .Remove(key, value));

            return(true);
        }
Example #2
0
        public void Clear()
        {
            var changes = new List <MapEvent <TK, TV> >(Count);

            changes.AddRange(myStorage.Select(kv => MapEvent <TK, TV> .Remove(kv.Key, kv.Value)));

            myStorage.Clear();

            foreach (var change in changes)
            {
                myChange.Fire(change);
            }
        }
Example #3
0
        public bool Remove(K key)
        {
            V value;

            if (!myMap.TryGetValue(key, out value))
            {
                return(false);
            }
            myMap.Remove(key);

            myChange.Fire(MapEvent <K, V> .Remove(key, value));

            return(true);
        }