Esempio n. 1
0
            /// <summary>
            /// Adds a new tree node to the end of the current tree node collection with the specified label text.
            /// </summary>
            /// <param name="text">The label text displayed by the TreeNode .</param>
            /// <returns>A TreeNode that represents the tree node being added to the collection.</returns>
            public ITreeNode Add(string text)
            {
                ITreeNode treeNode = _controlFactory.CreateTreeNode(text);

                Add(treeNode);
                return(treeNode);
            }
Esempio n. 2
0
        /// <summary>
        /// Adds a section to the treeview, under which individual items
        /// can be listed
        /// </summary>
        /// <param name="sectionName">The name of the section as it appears to the user</param>
        public void AddSection(string sectionName)
        {
            ITreeNode treeNode = _controlFactory.CreateTreeNode(sectionName);
            var       idx      = _treeView.Nodes.Add(treeNode);

            if (_currentSectionNode == null)
            {
                _treeView.TopNode = treeNode;
            }
            _currentSectionNode = treeNode;
            var hints = GlobalUIRegistry.UIStyleHints;

            if (hints != null)
            {
                if (hints.StaticDataEditorManagerHints.AutoExpandSections)
                {
                    _treeView.Nodes[idx].ExpandAll();
                }
            }
        }