Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
0
 public void AddNode(SiteMapNodeInfo node)
 {
     this.AddNode(node, 0x7fffffff);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule, int preferredDisplayOrder)
 {
     this.AddNode(node, parent, preferredDisplayOrder);
     this._nodeAuthorization.Add(node.Key, authorizationRule);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 11
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule)
 {
     this.AddNode(node, parent, authorizationRule, 0x7fffffff);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 13
0
 public void AddNode(SiteMapNodeInfo node, int preferredDisplayOrder)
 {
     this.SafeAddNode(node);
     this.AddNodeWithOrder(this.RootNode.Key, node, preferredDisplayOrder);
 }
Ejemplo n.º 14
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent)
 {
     this.AddNode(node, parent, 0x7fffffff);
 }
Ejemplo n.º 15
0
 public void AddNode(SiteMapNodeInfo node)
 {
     this.AddNode(node, 0x7fffffff);
 }
Ejemplo n.º 16
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent)
 {
     this.AddNode(node, parent, 0x7fffffff);
 }
Ejemplo n.º 17
0
 public void AddNode(SiteMapNodeInfo node, int preferredDisplayOrder)
 {
     this.SafeAddNode(node);
     this.AddNodeWithOrder(this.RootNode.Key, node, preferredDisplayOrder);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 19
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule, int preferredDisplayOrder)
 {
     this.AddNode(node, parent, preferredDisplayOrder);
     this._nodeAuthorization.Add(node.Key, authorizationRule);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 21
0
 public void AddNode(SiteMapNodeInfo node, SiteMapNodeInfo parent, string authorizationRule)
 {
     this.AddNode(node, parent, authorizationRule, 0x7fffffff);
 }