//public static void DetermineSelected(this XmlTreeNode node) //{ //} /// <summary> /// Determines if the node should be clickable based on the xpath given /// </summary> /// <param name="node">The node.</param> /// <param name="xpath">The xpath.</param> /// <param name="type">The type.</param> /// <param name="xml">The XML.</param> public static void DetermineClickable(this XmlTreeNode node, string xpath, XPathFilterType type, XElement xml) { if (!string.IsNullOrEmpty(xpath)) { try { var matched = xml.XPathSelectElements(xpath); if (matched.Count() > 0) { if (type == XPathFilterType.Disable) { //add the non-clickable color to the node node.Style.AddCustom("uc-treenode-noclick"); } else { //add the non-clickable color to the node node.Style.AddCustom("uc-treenode-click"); } } else { if (type == XPathFilterType.Disable) { //ensure the individual node is the correct color node.Style.AddCustom("uc-treenode-click"); } else { //ensure the individual node is the correct color node.Style.AddCustom("uc-treenode-noclick"); } } } catch (XPathException) { node.Text = "umbraco.editorControls: MNTP: XPath Error!"; } } else { if (type == XPathFilterType.Disable) { //ensure the individual node is the correct color node.Style.AddCustom("uc-treenode-click"); } else { //ensure the individual node is the correct color node.Style.AddCustom("uc-treenode-noclick"); } } }
internal static void MntpAddXPathFilterType(this HttpCookie c, int id, XPathFilterType type) { c[string.Concat(CookieVals.Xpft, "_", id)] = ((int)type).ToString(); }