Exemplo n.º 1
0
        private static string GetActiveTitle(string role, NavigationSiteMapNode node)
        {
            // Check whether a title has been specified for the user's role.

            string title = GetTitle(role, node);

            if (!string.IsNullOrEmpty(title))
            {
                return(title);
            }

            // Check whether the node itself specifies the title.

            title = node.Title;
            if (!string.IsNullOrEmpty(title))
            {
                return(title);
            }

            // Pass onto the parent.

            var parentNode = node.GetParentNode();

            return(parentNode == null ? null : GetActiveTitle(role, parentNode));
        }
Exemplo n.º 2
0
        private static string GetActiveValue(string key, string filterKey, string filterValue, NavigationSiteMapNode node)
        {
            // Check whether a value has been specified for the user's role.

            string value = GetValue(key, filterKey, filterValue, node);

            if (!string.IsNullOrEmpty(value))
            {
                return(value);
            }

            // Check whether the node itself specifies the value.

            value = node[key];
            if (!string.IsNullOrEmpty(value))
            {
                return(value);
            }

            // Pass onto the parent.

            var parentNode = node.GetParentNode();

            return(parentNode == null ? null : GetActiveValue(key, filterKey, filterValue, parentNode));
        }