/// <summary>
        /// Gets the link target.
        /// </summary>
        /// <param name="node">
        /// The node.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        protected virtual string GetLinkTarget(SiteMapNode node)
        {
            string target = NavigationUtilities.GetLinkTarget(node);

            if (target.IsNullOrEmpty())
            {
                target = "_self";
            }

            return(target);
        }
 /// <summary>
 /// Resolves the URL.
 /// </summary>
 /// <param name="node">
 /// The node.
 /// </param>
 /// <returns>
 /// The <see cref="string"/>.
 /// </returns>
 protected virtual string ResolveUrl(SiteMapNode node)
 {
     return(NavigationUtilities.ResolveUrl(node));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Returns the "target" HTML attribute of the link of the given
 /// <paramref name="sitefinitySiteMapNode"/>.
 /// </summary>
 /// <param name="sitefinitySiteMapNode">The SiteMap node where the link resides.</param>
 /// <returns>
 /// The link target, or an empty string if <paramref name="sitefinitySiteMapNode"/> is null.
 /// </returns>
 public string GetLinkTarget(ISitefinitySiteMapNode sitefinitySiteMapNode)
 {
     return(NavigationUtilities.GetLinkTarget(sitefinitySiteMapNode));
 }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BreadcrumbViewModel" /> class.
        /// </summary>
        /// <param name="list">The list.</param>
        public BreadcrumbViewModel(IEnumerable <SiteMapNode> list)
        {
            var collection = list.Select(n => new BreadcrumbNodeModel(NavigationUtilities.ResolveUrl(n), n.Title));

            this.SiteMapNodes = new ReadOnlyCollection <BreadcrumbNodeModel>(collection.ToList());
        }