示例#1
0
 public void Add(CounterChangeSet other)
 {
     foreach (var item in other.Changes)
     {
         AddValue(item.Key, item.Value);
     }
 }
示例#2
0
        public CounterChangeSet Uncount(Item item)
        {
            var changes = new CounterChangeSet();

            _tracker.Remove(item, ref changes);
            _counters.Add(changes);
            return(changes);
        }
示例#3
0
        public void Remove(Item item, ref CounterChangeSet changes)
        {
            foreach (var child in item.Contains)
            {
                Remove(child, ref changes);
            }

            _tracker.Remove(item, ref changes);
        }
示例#4
0
        public void Add(Item item, ref CounterChangeSet changes)
        {
            _tracker.Add(item, ref changes);

            foreach (var child in item.Contains)
            {
                Add(child, ref changes);
            }
        }
示例#5
0
        public void Remove(Item item, ref CounterChangeSet changes)
        {
            var diff = _cache.Remove(item);

            if (diff != 0)
            {
                changes.Add(item, diff);
            }
        }