Exemple #1
0
        /// <summary>
        /// Adds a new child tree node to me with specified name and icon.
        /// We also tell directly if this new child will be collapsed or not.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="newIconName">The icon name.</param>
        /// <param name="newCollapsed">If the new tree-node is collapsed.</param>
        /// <returns>The newly made and added (as child) tree-node.</returns>
        public TreeViewNode AddTreeNode(string name, string newIconName, bool newCollapsed)
        {
            var newNode = new TreeViewNode(name)
            {
                IconName = newIconName, 
                Collapsed = newCollapsed
            };

            this.AddControl(newNode);

            this.ParentRebuildPositions();

            return newNode;
        }
Exemple #2
0
        /// <summary>
        /// Adds a new child tree node to me with specified name.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>The newly made and added (as child) tree-node.</returns>
        public TreeViewNode AddTreeNode(string name)
        {
            var newNode = new TreeViewNode(name);

            this.AddControl(newNode);

            this.ParentRebuildPositions();

            return newNode;
        }