当前位置: 首页>>代码示例>>C#>>正文


C# XmlTreeNode.DetermineClickable方法代码示例

本文整理汇总了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);
        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:35,代码来源:FilteredContentTree.cs

示例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);
        }
开发者ID:bokmadsen,项目名称:uComponents,代码行数:24,代码来源:FilteredMediaTree.cs


注:本文中的umbraco.cms.presentation.Trees.XmlTreeNode.DetermineClickable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。