public void Add(CounterChangeSet other) { foreach (var item in other.Changes) { AddValue(item.Key, item.Value); } }
public CounterChangeSet Uncount(Item item) { var changes = new CounterChangeSet(); _tracker.Remove(item, ref changes); _counters.Add(changes); return(changes); }
public void Remove(Item item, ref CounterChangeSet changes) { foreach (var child in item.Contains) { Remove(child, ref changes); } _tracker.Remove(item, ref changes); }
public void Add(Item item, ref CounterChangeSet changes) { _tracker.Add(item, ref changes); foreach (var child in item.Contains) { Add(child, ref changes); } }
public void Remove(Item item, ref CounterChangeSet changes) { var diff = _cache.Remove(item); if (diff != 0) { changes.Add(item, diff); } }