Ejemplo n.º 1
0
 protected virtual void GetDescendantsInternal(ISiteMapNode node, ISiteMapNodeCollection descendants)
 {
     foreach (var child in node.ChildNodes)
     {
         descendants.Add(child);
         GetDescendantsInternal(child, descendants);
     }
 }
Ejemplo n.º 2
0
 protected virtual void GetAncestorsInternal(ISiteMapNode node, ISiteMapNodeCollection ancestors)
 {
     if (node.ParentNode != null)
     {
         ancestors.Add(node.ParentNode);
         GetAncestorsInternal(node.ParentNode, ancestors);
     }
 }
        public ReadOnlySiteMapNodeCollection(
            ISiteMapNodeCollection siteMapNodeCollection
            )
        {
            if (siteMapNodeCollection == null)
                throw new ArgumentNullException("siteMapNodeCollection");

            this.siteMapNodeCollection = siteMapNodeCollection;
        }
Ejemplo n.º 4
0
        public ReadOnlySiteMapNodeCollection(
            ISiteMapNodeCollection siteMapNodeCollection
            )
        {
            if (siteMapNodeCollection == null)
            {
                throw new ArgumentNullException("siteMapNodeCollection");
            }

            this.siteMapNodeCollection = siteMapNodeCollection;
        }
Ejemplo n.º 5
0
        public virtual ISiteMapNodeCollection GetChildNodes(ISiteMapNode node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }
            ISiteMapNodeCollection collection = null;

            if (this.childNodeCollectionTable.ContainsKey(node))
            {
                collection = this.childNodeCollectionTable[node];
            }
            if (collection == null)
            {
                ISiteMapNode keyNode = null;
                if (this.keyTable.ContainsKey(node.Key))
                {
                    keyNode = this.keyTable[node.Key];
                }
                if (keyNode != null && this.childNodeCollectionTable.ContainsKey(keyNode))
                {
                    collection = this.childNodeCollectionTable[keyNode];
                }
            }
            if (collection == null)
            {
                return(siteMapChildStateFactory.CreateEmptyReadOnlySiteMapNodeCollection());
            }
            if (!this.SecurityTrimmingEnabled)
            {
                return(siteMapChildStateFactory.CreateReadOnlySiteMapNodeCollection(collection));
            }
            var secureCollection = siteMapChildStateFactory.CreateSiteMapNodeCollection();

            foreach (ISiteMapNode secureNode in collection)
            {
                if (secureNode.IsAccessibleToUser())
                {
                    secureCollection.Add(secureNode);
                }
            }
            return(siteMapChildStateFactory.CreateReadOnlySiteMapNodeCollection(secureCollection));
        }
Ejemplo n.º 6
0
 protected virtual void GetDescendantsInternal(ISiteMapNode node, ISiteMapNodeCollection descendants)
 {
     foreach (var child in node.ChildNodes)
     {
         descendants.Add(child);
         GetDescendantsInternal(child, descendants);
     }
 }
Ejemplo n.º 7
0
 protected virtual void GetAncestorsInternal(ISiteMapNode node, ISiteMapNodeCollection ancestors)
 {
     if (node.ParentNode != null)
     {
         ancestors.Add(node.ParentNode);
         GetAncestorsInternal(node.ParentNode, ancestors);
     }
 }
 public virtual ISiteMapNodeCollection CreateReadOnly(ISiteMapNodeCollection siteMapNodeCollection)
 {
     return(new ReadOnlySiteMapNodeCollection(siteMapNodeCollection));
 }
 public virtual ISiteMapNodeCollection CreateReadOnlySiteMapNodeCollection(ISiteMapNodeCollection siteMapNodeCollection)
 {
     return siteMapNodeCollectionFactory.CreateReadOnly(siteMapNodeCollection);
 }
 public ISiteMapNodeCollection CreateReadOnlySiteMapNodeCollection(ISiteMapNodeCollection siteMapNodeCollection)
 {
     return(siteMapNodeCollectionFactory.CreateReadOnly(siteMapNodeCollection));
 }
 public virtual ISiteMapNodeCollection CreateReadOnly(ISiteMapNodeCollection siteMapNodeCollection)
 {
     return new ReadOnlySiteMapNodeCollection(siteMapNodeCollection);
 }