/// <summary> /// Adds a new child node. /// </summary> /// <param name="label">Node's label.</param> /// <returns>Newly created control.</returns> public TreeNode AddNode(string label) { TreeNode node = new TreeNode(this); node.Text = label; node.Dock = Pos.Top; node.IsRoot = this is TreeControl; node.TreeControl = m_TreeControl; if (m_TreeControl != null) { m_TreeControl.OnNodeAdded(node); } return node; }
/// <summary> /// Handler for node added event. /// </summary> /// <param name="node">Node added.</param> public virtual void OnNodeAdded(TreeNode node) { node.LabelPressed += OnNodeSelected; }