public static void DeserializeAll(XElement xmlDropDowns) { /* * <Dropdowns> * ... * </Dropdowns> */ // Go through every dropdown foreach (XElement xmlDropDown in xmlDropDowns.Descendants("Dropdown")) { // Get id: string id = xmlDropDown.Attribute("id").Value; // If such a combobox exists, deserialize: if (DropDown.ContainsKey(id)) { DropDown.Get(id).Deserialize(xmlDropDown); } } }
public static void Add(string key, DropDown comboBox) { Dict.Add(key, comboBox); }