public MyDictionary Merge(MyDictionary dictionary, string newDictionaryName) { MyDictionary newDictionary = new MyDictionary(newDictionaryName); var keys = this.dictionary.Keys; foreach (var key in keys) { newDictionary.Add(key, this.dictionary[key]); } keys = dictionary.dictionary.Keys; foreach (var key in keys) { string tempValue = dictionary.dictionary[key]; if (!newDictionary.ContainsKey(key) && !newDictionary.ContainsValue(tempValue)) { newDictionary.Add(key, tempValue); } } return(newDictionary); }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { currentDictionary = myDictionaries[listBox1.SelectedIndex]; RefreshWords(); }