static public DICT <K, V> .DictNode[] GetDictNodes <K, V>(DICT <K, V> dict) { K[] keys = dict.ToKeyArray(); DICT <K, V> .DictNode[] array = new DICT <K, V> .DictNode[dict.Count]; for (int i = 0; i < dict.Count; i++) { array[i] = new DICT <K, V> .DictNode(keys[i], dict[keys[i]]); } keys = null; return(array); }
static public DICT <T, V> Create <T, V>(params DICT <T, V> .DictNode[] nodes) { DICT <T, V> dict = new DICT <T, V>(); if (nodes == null) { return(dict); } foreach (DICT <T, V> .DictNode node in nodes) { if (!dict.ContainsKey(node.Key)) { dict.Add(node.Key, node.Value); } else { throw new ArgumentException("Dictonaries do not accept duplicate 'Keys'!"); } } return(dict); }
virtual public void Add(DICT <TKey, TValue> .DictNode item) { this.Add(item.Key, item.Value); }