public void SetDefaultValues(List <String> values) { if (base.defaultValueField == null) { this.InitDefaultField(); } MultiInputField defaultField = (MultiInputField)base.defaultValueField; if (defaultField.GetValues() != null && defaultField.GetValues().Count > 0) { defaultField.GetValues().Clear(); } foreach (String v in values) { defaultField.AddValue(v); } }
public List <String> GetDefaultValues() { if (base.defaultValueField == null) { this.InitDefaultField(); } List <String> result = new List <String>(); MultiInputField defaultField = (MultiInputField)base.defaultValueField; List <Value> vList = defaultField.GetValues(); foreach (Value v in vList) { result.Add(v.PropertyValue); } return(result); }
public override XmlElement ToDefaultValueElement() { MultiInputField defaultField = (MultiInputField)base.defaultValueField; List <Value> defaultValues = defaultField.GetValues(); if (defaultValues == null || defaultValues.Count == 0) { return(null); } XmlElement valuesNode = XmlUtils.CreateRootElement("default-values"); foreach (Value value in defaultValues) { XmlElement valueNode = XmlUtils.AppendElement(valuesNode, "default-value"); valueNode.InnerText = value.PropertyValue; } return(valuesNode); }