Example #1
0
        /// <summary>
        /// 读取XML中的属性内容
        /// </summary>
        /// <param name="aribute">包含属性的XML节点</param>
        /// <param name="box">属性所在的CodeBox对象</param>
        /// <returns></returns>
        public static void ReadXAributeObject(XmlNode node, CodeBox box)
        {
            XmlElement aributeElement = (XmlElement)node;
            int        Id             = int.Parse(aributeElement.GetAttribute("ID"));
            string     Title          = aributeElement.GetAttribute("Title");

            XAribute.XAttributeType SelectType          = XAribute.XAttributeTypeMapping(aributeElement.GetAttribute("PointTypeitem"));
            XAribute.XAttributeSpec SelectSpc           = XAribute.XAttributeSpecMapping(aributeElement.GetAttribute("ListTypeitem"));
            XAribute.XPositonStyle  SelectPositionStyle = XAribute.XPositonStyleMapping(aributeElement.GetAttribute("PositionTypeitem"));
            XAribute.CanLinkType    CanLinkNum          = XAribute.CanLinkTypeMapping(aributeElement.GetAttribute("LinkTypeitem"));
            string Hint   = aributeElement.GetAttribute("TipTypeitem");
            string ExName = aributeElement.GetAttribute("LastExTexteitem");

            XObject.OpenType opentype = XObject.OpenTypeMapping(aributeElement.GetAttribute("OpenType"));
            ///通过内置函数加载属性
            XAribute bute = box.LoadAttribute(SelectType, SelectSpc, SelectPositionStyle, Title, CanLinkNum, Hint, ExName, Id, opentype);

            if (bute != null && ISXAributeToSaveValue(bute))
            {
                bute.SetValueTextBox(aributeElement.GetAttribute("Value"));
            }
        }