public void Save(XmlElement xmlElem) { xmlElem.SetAttribute("type", parameterType.ToString()); for (int i = 0; i < options.Count; i++) { IParameterOption option = options[i]; XmlElement elemOption = xmlElem.OwnerDocument.CreateElement("option"); option.Save(elemOption); xmlElem.AppendChild(elemOption); } }
public ParameterControl_Option(IParameter parameter) : base(parameter) { this.comboBox = new ComboBox(); this.comboBox.DropDownStyle = ComboBoxStyle.DropDownList; IParameterOptions options = parameter.Options; List <IParameterOption> optionList = options.Options; int selectIndex = 0; for (int i = 0; i < optionList.Count; i++) { IParameterOption option = optionList[i]; this.comboBox.Items.Add(option.Value); if (option.Value.Equals(parameter.Value)) { selectIndex = i; } } comboBox.SelectedIndex = selectIndex; }