Пример #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);
        }
Пример #2
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);
        }
Пример #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);
        }
Пример #4
0
 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));
 }
Пример #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);
        }
Пример #6
0
        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);
        }
Пример #7
0
 public void AddNode(SiteMapNodeInfo node)
 {
     this.AddNode(node, 0x7fffffff);
 }
Пример #8
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);
        }
Пример #9
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule, int preferredDisplayOrder)
 {
     this.AddNode(node, parent, preferredDisplayOrder);
     this._nodeAuthorization.Add(node.Key, authorizationRule);
 }
Пример #10
0
 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);
 }
Пример #11
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule)
 {
     this.AddNode(node, parent, authorizationRule, 0x7fffffff);
 }
Пример #12
0
 public void AddNode(SiteMapNodeInfo node, string authorizationRule, int preferredDisplayOrder)
 {
     Guard.IsNotNullNorEmpty(authorizationRule, "authorizationRule");
     this.AddNode(node, preferredDisplayOrder);
     this._nodeAuthorization.Add(node.Key, authorizationRule);
 }
Пример #13
0
 public void AddNode(SiteMapNodeInfo node, int preferredDisplayOrder)
 {
     this.SafeAddNode(node);
     this.AddNodeWithOrder(this.RootNode.Key, node, preferredDisplayOrder);
 }
Пример #14
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent)
 {
     this.AddNode(node, parent, 0x7fffffff);
 }
Пример #15
0
 public void AddNode(SiteMapNodeInfo node)
 {
     this.AddNode(node, 0x7fffffff);
 }
Пример #16
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent)
 {
     this.AddNode(node, parent, 0x7fffffff);
 }
Пример #17
0
 public void AddNode(SiteMapNodeInfo node, int preferredDisplayOrder)
 {
     this.SafeAddNode(node);
     this.AddNodeWithOrder(this.RootNode.Key, node, preferredDisplayOrder);
 }
Пример #18
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);
        }
Пример #19
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule, int preferredDisplayOrder)
 {
     this.AddNode(node, parent, preferredDisplayOrder);
     this._nodeAuthorization.Add(node.Key, authorizationRule);
 }
Пример #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);
 }
Пример #21
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule)
 {
     this.AddNode(node, parent, authorizationRule, 0x7fffffff);
 }