public void AddChild(CustomTreeNode node)
        {
            if (children == null)
            {
                children = new List <CustomTreeNode>(4);
            }

            children.Add(node);
        }
Exemple #2
0
        /// <summary>
        /// Update tree, refresh all settings and redraw
        /// </summary>
        /// <param name="rootNode">new root node. Can not be null</param>
        public void Update(CustomTreeNode rootNode)
        {
            // if null is set for root node, swap it with our fake node
            if (rootNode == null)
            {
                rootNode = fakeEmptyNode;
            }

            this.selectedNode = null;             // selected node should be cleared
            this.rootNode     = rootNode;
            this.rootNode.Init();
            Refresh();
        }
Exemple #3
0
        private void RedrawSelected(CustomTreeNode old, CustomTreeNode current)
        {
            this.nodeDrawer.BeginDraw();
            if (old != null)
            {
                nodeDrawer.Draw(old, false);
            }

            if (current != null)
            {
                nodeDrawer.Draw(current, true);
            }

            this.nodeDrawer.EndDraw();
        }