示例#1
0
文件: ViewableMap.cs 项目: yvvan/rd
        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);
        }
示例#2
0
文件: ViewableMap.cs 项目: yvvan/rd
        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);
            }
        }
示例#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);
        }