Exemple #1
0
        private void SafeAddNode(SiteMapNodeInfo node)
        {
            Guard.IsNotNull(node, "node");
            if (this._keyIndex.ContainsKey(node.Key))
            {
                throw new ApplicationException("Duplicate key");
            }

            this._keyIndex.Add(node.Key, node);
        }
        public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, int preferredDisplayOrder)
        {
            this.SafeAddNode(node);
            if (!this._childNodes.ContainsKey(parent.Key))
            {
                this._childNodes.Add(parent.Key, new List<SiteMapNodeInfo>());
            }

            this.AddNodeWithOrder(parent.Key, node, preferredDisplayOrder);
        }
Exemple #3
0
        public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, int preferredDisplayOrder)
        {
            this.SafeAddNode(node);
            if (!this._childNodes.ContainsKey(parent.Key))
            {
                this._childNodes.Add(parent.Key, new List <SiteMapNodeInfo>());
            }

            this.AddNodeWithOrder(parent.Key, node, preferredDisplayOrder);
        }
 private SiteMapNode CreateSiteMapNode(SiteMapNodeInfo nodeInfo)
 {
     return(new SiteMapNode(
                this,
                nodeInfo.Key,
                nodeInfo.Url,
                nodeInfo.Title,
                nodeInfo.Description, nodeInfo.Roles, nodeInfo.Attributes,
                nodeInfo.ExplicitResourcesKey, nodeInfo.ImplicitResourceKey));
 }
Exemple #5
0
        private void AddNodeWithOrder(string parentKey, SiteMapNodeInfo node, int preferredDisplayOrder)
        {
            this._nodePreferredOrder.Add(node.Key, preferredDisplayOrder);
            for (int i = 0; i < this._childNodes[parentKey].Count; i++)
            {
                string key = this._childNodes[parentKey][i].Key;
                if (this._nodePreferredOrder[key] > preferredDisplayOrder)
                {
                    this._childNodes[parentKey].Insert(i, node);
                    return;
                }
            }

            this._childNodes[parentKey].Add(node);
        }
        public override SiteMapNode BuildSiteMap()
        {
            if (!this._isInitialized)
            {
                lock (this._lockObject)
                {
                    if (!this._isInitialized)
                    {
                        SiteMapNodeInfo rootNode = this.SiteMapBuilder.RootNode;
                        this._rootNode = this.CreateSiteMapNode(rootNode);
                        this.AddChildNodes(this._rootNode, this.SiteMapBuilder.GetChildren(rootNode.Key));
                        this._isInitialized = true;
                    }
                }
            }

            return(this._rootNode);
        }
Exemple #7
0
 public void AddNode(SiteMapNodeInfo node)
 {
     this.AddNode(node, 0x7fffffff);
 }
        private void SafeAddNode(SiteMapNodeInfo node)
        {
            Guard.IsNotNull(node, "node");
            if (this._keyIndex.ContainsKey(node.Key))
            {
                throw new ApplicationException("Duplicate key");
            }

            this._keyIndex.Add(node.Key, node);
        }
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule, int preferredDisplayOrder)
 {
     this.AddNode(node, parent, preferredDisplayOrder);
     this._nodeAuthorization.Add(node.Key, authorizationRule);
 }
 private SiteMapNode CreateSiteMapNode(SiteMapNodeInfo nodeInfo)
 {
     return new SiteMapNode(
                this,
                nodeInfo.Key,
                nodeInfo.Url,
                nodeInfo.Title,
                nodeInfo.Description, nodeInfo.Roles, nodeInfo.Attributes,
                nodeInfo.ExplicitResourcesKey, nodeInfo.ImplicitResourceKey);
 }
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule)
 {
     this.AddNode(node, parent, authorizationRule, 0x7fffffff);
 }
 public void AddNode(SiteMapNodeInfo node, string authorizationRule, int preferredDisplayOrder)
 {
     Guard.IsNotNullNorEmpty(authorizationRule, "authorizationRule");
     this.AddNode(node, preferredDisplayOrder);
     this._nodeAuthorization.Add(node.Key, authorizationRule);
 }
 public void AddNode(SiteMapNodeInfo node, int preferredDisplayOrder)
 {
     this.SafeAddNode(node);
     this.AddNodeWithOrder(this.RootNode.Key, node, preferredDisplayOrder);
 }
Exemple #14
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent)
 {
     this.AddNode(node, parent, 0x7fffffff);
 }
 public void AddNode(SiteMapNodeInfo node)
 {
     this.AddNode(node, 0x7fffffff);
 }
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent)
 {
     this.AddNode(node, parent, 0x7fffffff);
 }
Exemple #17
0
 public void AddNode(SiteMapNodeInfo node, int preferredDisplayOrder)
 {
     this.SafeAddNode(node);
     this.AddNodeWithOrder(this.RootNode.Key, node, preferredDisplayOrder);
 }
        private void AddNodeWithOrder(string parentKey, SiteMapNodeInfo node, int preferredDisplayOrder)
        {
            this._nodePreferredOrder.Add(node.Key, preferredDisplayOrder);
            for (int i = 0; i < this._childNodes[parentKey].Count; i++)
            {
                string key = this._childNodes[parentKey][i].Key;
                if (this._nodePreferredOrder[key] > preferredDisplayOrder)
                {
                    this._childNodes[parentKey].Insert(i, node);
                    return;
                }
            }

            this._childNodes[parentKey].Add(node);
        }
Exemple #19
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule, int preferredDisplayOrder)
 {
     this.AddNode(node, parent, preferredDisplayOrder);
     this._nodeAuthorization.Add(node.Key, authorizationRule);
 }
Exemple #20
0
 public void AddNode(SiteMapNodeInfo node, string authorizationRule, int preferredDisplayOrder)
 {
     Guard.IsNotNullNorEmpty(authorizationRule, "authorizationRule");
     this.AddNode(node, preferredDisplayOrder);
     this._nodeAuthorization.Add(node.Key, authorizationRule);
 }
Exemple #21
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule)
 {
     this.AddNode(node, parent, authorizationRule, 0x7fffffff);
 }