private void AddChildNodes(SiteMapNode parent, ReadOnlyCollection <SiteMapNodeInfo> children) { if (children.Count > 0) { foreach (SiteMapNodeInfo child in children) { SiteMapNode childNode = CreateSiteMapNode(child); AddNode(childNode, parent); AddChildNodes(childNode, SiteMapBuilder.GetChildren(child.Key)); } } }
/// <summary> /// Builds the <see cref="SiteMap"/> managed by the provider. /// </summary> /// <returns>The root <see cref="SiteMapNode"/> for the provider.</returns> public override SiteMapNode BuildSiteMap() { if (!_isInitialized) { lock (_lockObject) { if (!_isInitialized) { SiteMapNodeInfo rootNodeInfo = SiteMapBuilder.RootNode; _rootNode = CreateSiteMapNode(rootNodeInfo); AddChildNodes(_rootNode, SiteMapBuilder.GetChildren(rootNodeInfo.Key)); _isInitialized = true; } } } return(_rootNode); }