예제 #1
0
        /// <summary>
        /// 读取XML中的属性内容
        /// </summary>
        /// <param name="aribute">包含属性的XML节点</param>
        /// <param name="box">属性所在的CodeBox对象</param>
        /// <returns></returns>
        public static void ReadXAributeObject(XmlNode node, PicTabPage pic)
        {
            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 = pic.LoadXAribute(SelectType, SelectSpc, SelectPositionStyle, Title, CanLinkNum, Hint, ExName, Id, opentype);
        }
예제 #2
0
        /// <summary>
        /// 读取函数内容
        /// </summary>
        /// <param name="picnode">代码图节点</param>
        /// <param name="pic">代码图(类)</param>
        public static void ReadFunction(XmlNode functionnode, PicTabPage pic)
        {
            XmlElement functionElement = (XmlElement)functionnode;
            string     Title           = functionElement.GetAttribute("Title");
            int        ID = int.Parse(functionElement.GetAttribute("ID"));

            XObject.OpenType myOpenType     = XObject.OpenTypeMapping(functionElement.GetAttribute("OpenType"));
            OverrideType     myOverrideType = XObject.OverrideTypeMapping(functionElement.GetAttribute("OverrideType"));

            PicFunctionTabPage functionpage = pic.LoadFunctionPage(Title, ID, myOpenType, myOverrideType);

            ///查找CodeBox节点
            foreach (XmlNode node in functionnode.SelectNodes("CodeBox"))
            {
                DataWriteFunction.ReadCodeBoxObject(node, functionpage);
            }
            ///查找BezierLine节点
            foreach (XmlNode node in functionnode.SelectNodes("BezierLine"))
            {
                DataWriteFunction.ReadBezierLine(node, functionpage);
            }
        }
예제 #3
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"));
            }
        }