public Option AddOption(String displayName, String value) { Option option = new Option(); option.SetDisplayName(displayName); option.Value = value; this.Add(option); return option; }
private static Option ElementToOption(XmlElement optionEle, string fieldId) { Option opResult = new Option(); String displayName = XmlUtils.GetAttributeValue(optionEle, "displayName"); if (StringUtil.IsEmpty(displayName)) { throw new TopSchemaException(TopSchemaErrorCodeEnum.ERROR_CODE_33001, fieldId); } String value = XmlUtils.GetAttributeValue(optionEle, "value"); if (StringUtil.IsEmpty(value)) { throw new TopSchemaException(TopSchemaErrorCodeEnum.ERROR_CODE_33002, fieldId); } opResult.SetDisplayName(displayName); opResult.Value = value; XmlElement dependGroupEle = XmlUtils.GetChildElement(optionEle, "depend-group"); DependGroup dependGroup = ElementToDependGroup(dependGroupEle, fieldId); opResult.SetDependGroup(dependGroup); return opResult; }
public Option AddOption() { Option option = new Option(); this.Add(option); return option; }
public void Add(Option option) { this.options.Add(option); }