コード例 #1
0
        private HtmlGenericControl CreateNode(AccessibleTreeNode treeNode)
        {
            HtmlGenericControl li = new HtmlGenericControl("li");

            li.Controls.Add(treeNode);

            if (treeNode.ChildNodes.Count > 0)
            {
                li.Attributes.Add("class", "openednode");
            }

            if (treeNode.Expanded && treeNode.ChildNodes.Count > 0)
            {
                HtmlGenericControl ulChild = new HtmlGenericControl("ul");

                foreach (AccessibleTreeNode childNode in treeNode.ChildNodes)
                {
                    ulChild.Controls.Add(this.CreateNode(childNode));
                }

                li.Controls.Add(ulChild);
            }

            return(li);
        }
コード例 #2
0
        private void RestoreNodes(ArrayList nodes)
        {
            foreach (Hashtable properties in nodes)
            {
                AccessibleTreeNode treeNode = new AccessibleTreeNode();

                treeNode.ID   = properties["id"].ToString();
                treeNode.Text = properties["text"].ToString();
                treeNode.Link = properties["link"].ToString();

                try
                {
                    if (Convert.ToBoolean(properties["expanded"]))
                    {
                        treeNode.Expand();
                    }
                }
                catch
                {
                }

                this.Nodes.Add(treeNode);
            }
        }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="parentNode"></param>
 internal void SetParentNode(AccessibleTreeNode parentNode)
 {
     this._parentNode = parentNode;
 }
コード例 #4
0
            public void Add(AccessibleTreeNode treeNode)
            {
                this.InnerList.Add(treeNode);

                treeNode.SetParentNode(this._parentNode);
            }