Esempio n. 1
0
 /// <summary>
 /// 根据模板名称加载模板控件列表
 /// </summary>
 /// <param name="editname">模板名称</param>
 private DataTable LoadCustomControlList(string editname)
 {
     if (editname != string.Empty)
     {
         XmlDocument document = EditTemplateInfo.GetEditXmlDocument(EditName.Substring(0, EditName.IndexOf(".")) + ".xml");//获取编辑模板XML
         XmlElement  parent   = document.DocumentElement;
         //模板中文说明|也就是模板所代表的纸面意思
         Lb_cname.Text = parent.ChildNodes[2].InnerText;
         //遍历所有的控件项节点|并添加到数据集中
         DataTable controltb = GetControlDB(EditName);
         foreach (XmlElement item in parent.ChildNodes[4])
         {
             DataRow controlrow = controltb.NewRow();
             controlrow["TAB_INDEX"]   = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("TAB_INDEX"));
             controlrow["ITEM_CNAME"]  = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("ITEM_CNAME"));
             controlrow["ITEM_ENAME"]  = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("ITEM_ENAME"));
             controlrow["ITEM_WIDTH"]  = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("ITEM_WIDTH"));
             controlrow["ITEM_HEIGHT"] = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("ITEM_HEIGHT"));
             controlrow["POS_X"]       = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("POS_X"));
             controlrow["POS_Y"]       = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("POS_Y"));
             controlrow["MULTILINE"]   = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("MULTILINE")) == "1" ? "是" : "否";
             controlrow["WORD_WRAP"]   = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("WORD_WRAP")) == "1" ? "是" : "否";
             controlrow["ITEM_TYPE"]   = EditTemplateMethod.GetXmlNodeText(item.SelectSingleNode("ITEM_TYPE"));
             controltb.Rows.Add(controlrow);
         }
         Lb_controlcount.Text             = controltb.Rows.Count.ToString();//控件总数
         DGV_CustomControlList.DataSource = controltb;
         return(controltb);
     }
     return(null);
 }
Esempio n. 2
0
 /// <summary>
 /// 保存模板中的全局节点
 /// </summary>
 /// <param name="document">XmlDocument</param>
 /// <param name="root">根节点</param>
 private void SaveGlobalXmlNode(XmlDocument document, XmlElement root)
 {
     //模板代码
     EditTemplateMethod.AppendChildElement(document, root, "CODE", EditTemplateInfo.GetEditXmlDocument((EditName.Substring(0, EditName.IndexOf(".")) + ".xml")).DocumentElement.ChildNodes[0].InnerText);
     //模板底图
     EditTemplateMethod.AppendChildElement(document, root, "BACK_IMG", EditTemplateInfo.GetEditXmlDocument((EditName.Substring(0, EditName.IndexOf(".")) + ".xml")).DocumentElement.ChildNodes[1].InnerText);
     //模板中文名称
     EditTemplateMethod.AppendChildElement(document, root, "CNAME", EditTemplateInfo.GetEditXmlDocument((EditName.Substring(0, EditName.IndexOf(".")) + ".xml")).DocumentElement.ChildNodes[2].InnerText);
     //模板英文名称
     EditTemplateMethod.AppendChildElement(document, root, "ENAME", EditTemplateInfo.GetEditXmlDocument((EditName.Substring(0, EditName.IndexOf(".")) + ".xml")).DocumentElement.ChildNodes[3].InnerText);
 }
Esempio n. 3
0
 private void FrmEditInfoBox_Load(object sender, EventArgs e)
 {
     try
     {
         string filepath = EditTemplateInfo.GetEditXmlPathName((EditPath.Substring(0, EditPath.IndexOf(".")) + ".xml"));
         Lb_editname.Text       = EditTemplateInfo.GetEditXmlDocument((EditPath.Substring(0, EditPath.IndexOf(".")) + ".xml")).DocumentElement.ChildNodes[2].InnerText;
         Lb_createtime.Text     = File.GetCreationTime(filepath).ToString();
         Lb_lastwritetime.Text  = File.GetLastAccessTime(filepath).ToString();
         Lb_lastaccesstime.Text = File.GetLastWriteTime(filepath).ToString();
     }
     catch { }
 }
Esempio n. 4
0
 /// <summary>
 /// 窗体加载时
 /// </summary>
 private void FrmEditfrom_Load(object sender, EventArgs e)
 {
     try
     {
         //模板的英文名称
         EditEname = EditTemplateInfo.GetEditXmlDocument(Editname.Substring(0, Editname.IndexOf(".")) + ".xml").DocumentElement.ChildNodes[3].InnerText;
         //生成模板
         InitCustomConfig(EditTemplateInfo.GetEditXmlDocument(Editname.Substring(0, Editname.IndexOf(".")) + ".xml"));
         //填充模板
         FillCustomControl();
     }
     catch { }
 }