public void Add(TK key, TV value) { IGrouping <TK, TV> tmpList; if (!m_dictionary.TryGetValue(key, out tmpList)) { m_dictionary[key] = tmpList = new GroupingWrapper(key); } GroupingWrapper list = (GroupingWrapper)tmpList; list.Add(value); Count += 1; }
private void RemoveValueInternal(TK key, TV value) { IGrouping <TK, TV> tmpList; if (!m_dictionary.TryGetValue(key, out tmpList)) { return; } GroupingWrapper list = (GroupingWrapper)tmpList; list.Remove(value); if (list.Count == 0) { m_dictionary.Remove(key); } }