Пример #1
0
        /// <summary>
        /// 生成模板文件
        /// </summary>
        public void MarkTemplet(string sitePath, string tempPath, string skinName, string dirPath, string xPath)
        {
            XmlNodeList xnList = HotoXmlHelper.ReadNodes(dirPath + HotoKeys.FILE_PLUGIN_XML_CONFING, xPath);

            foreach (XmlElement xe in xnList)
            {
                if (xe.NodeType != XmlNodeType.Comment && xe.Name.ToLower() == "rewrite")
                {
                    if (xe.Attributes["page"] != null && !string.IsNullOrEmpty(xe.Attributes["page"].InnerText) &&
                        !string.IsNullOrEmpty(xe.Attributes["templet"].InnerText) && !string.IsNullOrEmpty(xe.Attributes["inherit"].InnerText))
                    {
                        //生成模板文件
                        HotoPageTemplate.GetTemplate(sitePath, tempPath, skinName, xe.Attributes["templet"].InnerText, xe.Attributes["page"].InnerText, xe.Attributes["inherit"].InnerText, 0, 1);
                    }
                }
            }
        }
Пример #2
0
 /// <summary>
 /// 读取所有子节点的的值
 /// </summary>
 private List <string> ReadChildNodesValue(string filePath, string xPath)
 {
     try
     {
         List <string> ls     = new List <string>();
         XmlNodeList   xnList = HotoXmlHelper.ReadNodes(filePath, xPath);
         if (xnList.Count > 0)
         {
             foreach (XmlElement xe in xnList)
             {
                 if (xe.NodeType != XmlNodeType.Comment && xe.Name.ToLower() == "sql" && !string.IsNullOrEmpty(xe.InnerText))
                 {
                     ls.Add(xe.InnerText);
                 }
             }
         }
         return(ls);
     }
     catch
     {
         return(null);
     }
 }
Пример #3
0
        /// <summary>
        /// 删除URL映射节点
        /// </summary>
        public bool RemoveNodes(string dirPath, string xPath)
        {
            XmlNodeList xnList = HotoXmlHelper.ReadNodes(dirPath + HotoKeys.FILE_PLUGIN_XML_CONFING, xPath);

            return(new url_rewrite().Remove(xnList));
        }
Пример #4
0
 /// <summary>
 /// 修改插件节点数据
 /// </summary>
 public bool UpdateNodeValue(string dirPath, string xPath, string value)
 {
     return(HotoXmlHelper.UpdateNodeInnerText(dirPath + HotoKeys.FILE_PLUGIN_XML_CONFING, xPath, value));
 }