public void Add(T first, T second) { Dictionary <T, int> InnerMap; if (!Chain.ContainsKey(first)) { InnerMap = new Dictionary <T, int>(); InnerMap.Add(second, 0); Chain.Add(first, InnerMap); } else { InnerMap = Chain[first]; } if (!InnerMap.ContainsKey(second)) { InnerMap.Add(second, 0); } int weight = InnerMap[second]; InnerMap.Remove(second); InnerMap.Add(second, weight + 1); }
protected virtual void ClearPropertyCore(string property) { InnerMap.Remove(property); }