示例#1
0
        /// <summary>
        /// Converts the current object to its Mobise Studio XCode XML representation.
        /// </summary>
        /// <returns>
        /// An XML representation of the current object.
        /// </returns>
        public IList <XAttribute> ToRPXCD(IntegerInfoType infoType)
        {
            IList <XAttribute> attributes = new List <XAttribute>();

            if (this.Validate)
            {
                attributes.Add(new XAttribute("validate", this.Validate));
                attributes.Add(new XAttribute("minValue", this.MinValue));
                attributes.Add(new XAttribute("maxValue", this.MaxValue));
            }

            switch (infoType)
            {
            case IntegerInfoType.Lookup:
                return(new List <XAttribute>()
                {
                    new XAttribute("isLookup", true),
                    new XAttribute("lookupTableName", string.IsNullOrEmpty(this.LookupTableName) ? string.Empty : this.LookupTableName),
                    new XAttribute("lookupTableValue", this.LookupTableValue),
                    new XAttribute("sortByValue", this.SortByValue),
                    new XAttribute("sortAlphabetically", this.SortAlphabetically)
                });

            case IntegerInfoType.Money:
                attributes.Add(new XAttribute("moneySymbol", this.MoneySymbol));
                return(attributes);

            case IntegerInfoType.Numeric:
                return(attributes);

            case IntegerInfoType.Percentage:
                attributes.Add(new XAttribute("step", this.Step));
                return(attributes);

            default:
                return(attributes);
            }
        }
示例#2
0
 /// <summary>
 /// Processes the XML.
 /// </summary>
 /// <param name="xmlAttributeInfo">The XML attribute info.</param>
 private void ProcessXml(XElement xmlAttributeInfo)
 {
     this.InfoType = xmlAttributeInfo.Attribute("infoType") != null ? (IntegerInfoType)Enum.Parse(typeof(IntegerInfoType), xmlAttributeInfo.Attribute("infoType").Value) : IntegerInfoType.Numeric;
 }