예제 #1
0
        /// <summary>
        /// add node into tree
        /// </summary>
        /// <param name="text"></param>
        /// <param name="imageIndex"></param>
        /// <param name="selectedImageIndex"></param>
        /// <param name="tooltip"></param>
        /// <param name="tag"></param>
        /// <returns></returns>
        public TreeViewSpliterItem AddNode(string text,
                                           int imageIndex = NoneIndex, int selectedImageIndex = NoneIndex, string tooltip = "", object tag = null)
        {
            TreeViewSpliterItem tsiItem = new TreeViewSpliterItem();
            string nodeID = GenNodeID();

            tsiItem.TreeNodeTop    = AddNode(trvTop.Nodes, nodeID, text, imageIndex, selectedImageIndex, tooltip, tag);
            tsiItem.TreeNodeBottom = AddNode(trvBottom.Nodes, nodeID, text, imageIndex, selectedImageIndex, tooltip, tag);

            return(tsiItem);
        }
예제 #2
0
        /// <summary>
        /// Add a node into tree
        /// </summary>
        /// <param name="topNodes"></param>
        /// <param name="type"></param>
        /// <param name="text"></param>
        /// <param name="imageIndex"></param>
        /// <param name="selectedImageIndex"></param>
        /// <param name="tooltip"></param>
        /// <param name="tag"></param>
        public TreeViewSpliterItem AddNode(TreeViewSpliterItem parentItem, string text,
                                           int imageIndex = NoneIndex, int selectedImageIndex = NoneIndex, string tooltip = "", object tag = null)
        {
            TreeViewSpliterItem tsi = new TreeViewSpliterItem();

            string nodeID = GenNodeID();

            if (parentItem != null && parentItem.TreeNodeTop != null)
            {
                tsi.TreeNodeTop = AddNode(parentItem.TreeNodeTop, nodeID, text, imageIndex, selectedImageIndex, tooltip, tag);
            }
            if (parentItem != null && parentItem.TreeNodeBottom != null)
            {
                tsi.TreeNodeBottom = AddNode(parentItem.TreeNodeBottom, nodeID, text, imageIndex, selectedImageIndex, tooltip, tag);
            }

            return(tsi);
        }