Ejemplo n.º 1
0
            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);
                }
            }
Ejemplo n.º 2
0
        /// <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());
        }
Ejemplo n.º 3
0
            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);
                }
            }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
 /// <exclude />
 public bool Equals(CompositeC1SiteMapNode obj)
 {
     return(Key == obj.Key && Culture.Equals(obj.Culture));
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        /// <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();
        }
Ejemplo n.º 8
0
 /// <exclude />
 public bool Equals(CompositeC1SiteMapNode obj)
 {
     return Key == obj.Key && Culture.Equals(obj.Culture);
 }