コード例 #1
0
        private static void ProcessNode(XmlWriter writer, string server, NavigationSiteMapNode node)
        {
            // Check that the node should be added.

            if (CanAddNode(node))
            {
                WriteNode(writer, server, node);
            }

            // Iterate over children.

            foreach (NavigationSiteMapNode childNode in node.ChildNodes)
            {
                ProcessNode(writer, server, childNode);
            }
        }
コード例 #2
0
        private static bool CanAddNode(NavigationSiteMapNode node)
        {
            // If the url is not specified or it is external then don't add.

            if (string.IsNullOrEmpty(node.Url) || node.Url.StartsWith("http"))
            {
                return(false);
            }

            // If it is a redirect node then don't add.

            if (node.Redirect)
            {
                return(false);
            }

            // If the node itself indicates that it is not crawlable then don't add.

            return(node.Crawlable);
        }