private static void LoadNodes(CompositeC1SiteMapProvider provider, PageNode pageNode, SiteMapNode parent, SiteMapContainer container, DataConnection data, int level) { if (pageNode.Url == null) { return; } var node = new CompositeC1SiteMapNode(provider, pageNode, data, level); AddNode(node, parent, container); var childs = pageNode.ChildPages; foreach (var child in childs) { LoadNodes(provider, child, node, container, data, level + 1); } }
/// <exclude /> public override SiteMapNode Clone() { var clone = new CompositeC1SiteMapNode((CompositeC1SiteMapProvider)this.Provider, this.Key); clone.DocumentTitle = this.DocumentTitle; clone.Description = this.Description; clone.Url = this.Url; clone.Culture = this.Culture; clone.Priority = this.Priority; clone.Depth = this.Depth; clone.LastModified = this.LastModified; clone.ChangeFrequency = this.ChangeFrequency; clone.DocumentTitle = this.DocumentTitle; clone.PageNode = this.PageNode; return(base.Clone()); }
private IHostnameBinding FindMatchingBinding(CompositeC1SiteMapNode sitemapNode, List <IHostnameBinding> bindings) { Guid homePageId = Guid.Parse(sitemapNode.Key); string cultureName = sitemapNode.Culture.Name; var bestMatch = bindings.SingleOrDefault(h => h.HomePageId == homePageId && h.Culture == cultureName); if (bestMatch != null) { return(bestMatch); } string defaultCulture = DataLocalizationFacade.DefaultLocalizationCulture.Name; var secondBestMatch = bindings.SingleOrDefault(h => h.HomePageId == homePageId && h.Culture == defaultCulture); if (secondBestMatch != null) { return(secondBestMatch); } return(bindings.OrderBy(b => b.Hostname).FirstOrDefault(h => h.HomePageId == homePageId)); }
/// <exclude /> public bool Equals(CompositeC1SiteMapNode obj) { return(Key == obj.Key && Culture.Equals(obj.Culture)); }
private IHostnameBinding FindMatchingBinding(CompositeC1SiteMapNode sitemapNode, List<IHostnameBinding> bindings) { Guid homePageId = Guid.Parse(sitemapNode.Key); string cultureName = sitemapNode.Culture.Name; var bestMatch = bindings.SingleOrDefault(h => h.HomePageId == homePageId && h.Culture == cultureName); if (bestMatch != null) { return bestMatch; } string defaultCulture = DataLocalizationFacade.DefaultLocalizationCulture.Name; var secondBestMatch = bindings.SingleOrDefault(h => h.HomePageId == homePageId && h.Culture == defaultCulture); if (secondBestMatch != null) { return secondBestMatch; } return bindings.OrderBy(b => b.Hostname).FirstOrDefault(h => h.HomePageId == homePageId); }
/// <exclude /> public override SiteMapNode Clone() { var clone = new CompositeC1SiteMapNode((CompositeC1SiteMapProvider)this.Provider, this.Key); clone.DocumentTitle = this.DocumentTitle; clone.Description = this.Description; clone.Url = this.Url; clone.Culture = this.Culture; clone.Priority = this.Priority; clone.Depth = this.Depth; clone.LastModified = this.LastModified; clone.ChangeFrequency = this.ChangeFrequency; clone.DocumentTitle = this.DocumentTitle; clone.PageNode = this.PageNode; return base.Clone(); }
/// <exclude /> public bool Equals(CompositeC1SiteMapNode obj) { return Key == obj.Key && Culture.Equals(obj.Culture); }