Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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);
            }
        }