public static bool UpdateCommentNode(int commentId, string type, System.Collections.Generic.Dictionary <string, string> commentnode) { bool result = false; string filename = HttpContext.Current.Request.MapPath(HiContext.Current.GetSkinPath() + "/config/Comments.xml"); XmlDocument commentDocument = TagsHelper.GetCommentDocument(); XmlNode xmlNode = TagsHelper.FindCommentNode(commentId, type); if (xmlNode != null) { foreach (System.Collections.Generic.KeyValuePair <string, string> current in commentnode) { xmlNode.Attributes[current.Key].Value = current.Value; } commentDocument.Save(filename); TagsHelper.RemoveCommentNodeCache(); result = true; } return(result); }
public static bool UpdateHeadMenuNode(int menuId, System.Collections.Generic.Dictionary <string, string> headmenunode) { string filename = HttpContext.Current.Request.MapPath(HiContext.Current.GetSkinPath() + "/config/HeaderMenu.xml"); bool result = false; XmlDocument commentDocument = TagsHelper.GetCommentDocument(); XmlNode xmlNode = TagsHelper.FindHeadMenuNode(menuId); if (xmlNode != null) { foreach (System.Collections.Generic.KeyValuePair <string, string> current in headmenunode) { xmlNode.Attributes[current.Key].Value = current.Value; } commentDocument.Save(filename); TagsHelper.RemoveHeadMenuCache(); result = true; } return(result); }
public static XmlNode FindCommentNode(int int_0, string type) { XmlDocument commentDocument = TagsHelper.GetCommentDocument(); return(commentDocument.SelectSingleNode(string.Format("//Comment[@Id='{0}' and @Type='{1}']", int_0, type))); }