本文整理汇总了C#中umbraco.cms.presentation.Trees.XmlTreeNode.DetermineClickable方法的典型用法代码示例。如果您正苦于以下问题:C# XmlTreeNode.DetermineClickable方法的具体用法?C# XmlTreeNode.DetermineClickable怎么用?C# XmlTreeNode.DetermineClickable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类umbraco.cms.presentation.Trees.XmlTreeNode
的用法示例。
在下文中一共展示了XmlTreeNode.DetermineClickable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRenderNode
/// <summary>
/// Called when [render node].
/// </summary>
/// <param name="xNode">The x node.</param>
/// <param name="doc">The doc.</param>
protected override void OnRenderNode(ref XmlTreeNode xNode, Document doc)
{
base.OnRenderNode(ref xNode, doc);
var dataTypeId = this.GetDataTypeId();
var xpath = this.GetXPathFromCookie(dataTypeId);
var xPathType = this.GetXPathFilterTypeFromCookie(dataTypeId);
// resolves any Umbraco params in the XPath
xpath = uQuery.ResolveXPath(xpath);
var xDoc = new XmlDocument();
XmlNode xmlDoc;
if (!doc.Published)
{
xmlDoc = doc.ToPreviewXml(xDoc);
}
else
{
xmlDoc = doc.ToXml(xDoc, false);
}
var xmlString = "<root>" + xmlDoc.OuterXml + "</root>";
var xml = XElement.Parse(xmlString);
xNode.DetermineClickable(xpath, xPathType, xml);
//ensure that the NodeKey is passed through
xNode.Source = this.GetTreeServiceUrlWithParams(int.Parse(xNode.NodeID), dataTypeId);
}
示例2: OnBeforeNodeRender
/// <summary>
/// Called when [before node render].
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="node">The node.</param>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
protected override void OnBeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
{
var xpath = this.GetXPathFromCookie(this.GetDataTypeId());
var xPathType = this.GetXPathFilterTypeFromCookie(this.GetDataTypeId());
var xDoc = new XmlDocument();
var xmlNode = umbraco.library.GetMedia(int.Parse(node.NodeID), false).Current.OuterXml;
var xmlString = "<root>" + xmlNode + "</root>";
var xml = XElement.Parse(xmlString);
node.DetermineClickable(xpath, xPathType, xml);
//ensure that the NodeKey is passed through
node.Source = this.GetTreeServiceUrlWithParams(int.Parse(node.NodeID), this.GetDataTypeId());
base.OnBeforeNodeRender(ref sender, ref node, e);
}