Ejemplo n.º 1
0
        /// <summary>
        /// 从文件加载一个属性
        /// </summary>
        /// <param name="xt">属性类型</param>
        /// <param name="xs">属性的集合类型</param>
        /// <param name="xp">复制匡的位置是在左边还是右边</param>
        /// <param name="paramterName">属性名称</param>
        /// <param name="clt">连接方式</param>
        /// <param name="tiptext">提示信息</param>
        /// <param name="LastExName">属性类型</param>
        /// <param name="id">属性框ID</param>
        /// <param name="opentype">公开类型</param>
        public XAribute LoadXAribute(XAribute.XAttributeType xt, XAribute.XAttributeSpec xs, XAribute.XPositonStyle xp, string paramterName, XAribute.CanLinkType clt, string tiptext, string LastExName, int id, OpenType opentype)
        {
            XAribute xb = new XAribute(id, paramterName, xt, xs, xp, this.ChileEventCallBack, clt, LastExName);

            xb.Hint       = tiptext;
            xb.MyOpenType = opentype;
            ///绑定标题改变事件
            xb.TitleChange += (e, o, v) =>
            {
                ///修改Title
                return(ModifyPropertyTitle(o, v));
            };
            xb.ExNameChange += (s, o, v) =>
            {
                ///修改ExName
                this.ModifyPropetyExName((s as XAribute).Title, v);
            };
            ///检测是否存在
            if (!ListXAributes.Contains(xb))
            {
                ListXAributes.Add(xb);
                return(xb);
            }
            return(null);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 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"));
            }
        }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="Parameter_name"></param>
 /// <param name="MyCanLinkType"></param>
 /// <param name="MyXAttributeSpec"></param>
 /// <param name="MyXAttributeType"></param>
 /// <param name="MyXPositonStyle"></param>
 /// <param name="MyHittext"></param>
 public XAributeItem(string Parameter_name, XAribute.CanLinkType MyCanLinkType, XAribute.XAttributeSpec MyXAttributeSpec,
                     XAribute.XAttributeType MyXAttributeType, XAribute.XPositonStyle MyXPositonStyle, string MyHittext, string MyLastExText)
 {
     this.Parameter_name   = Parameter_name;
     this.MyCanLinkType    = MyCanLinkType;
     this.MyXAttributeSpec = MyXAttributeSpec;
     this.MyXAttributeType = MyXAttributeType;
     this.MyXPositonStyle  = MyXPositonStyle;
     this.MyHittext        = MyHittext;
     this.MyLastExText     = MyLastExText;
 }