private void configPageTree_AfterSelect(object sender, TreeViewEventArgs e) { var node = e.Node as TreeNodeEx; if (node != null) { if (prevPage != null) prevPage.Visible = false; prevPage = node.LinkedPage; prevPage.Parent = configPageOwner; prevPage.Dock = DockStyle.Fill; prevPage.Visible = true; StringBuilder sb = new StringBuilder(); sb.Append(node.LinkedPage.Description); TreeNodeEx cn = node.Parent as TreeNodeEx; while (cn != null) { sb.Insert(0, cn.LinkedPage.Description + " - "); cn = cn.Parent as TreeNodeEx; } titleLabel.Text = sb.ToString(); } }
public TreeNodeEx(ConfigPage linked, TreeNodeEx[] children) : this(linked) { this.Nodes.AddRange(children); }
public TreeNodeEx(ConfigPage linked) : base() { _linkedPage = linked; this.Text = linked.Description; }