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); }
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); } }
/// <summary> /// /// </summary> /// <param name="parentNode"></param> internal void SetParentNode(AccessibleTreeNode parentNode) { this._parentNode = parentNode; }
public void Add(AccessibleTreeNode treeNode) { this.InnerList.Add(treeNode); treeNode.SetParentNode(this._parentNode); }