Exemplo n.º 1
0
        public SENavigationTreeNode SetPanel(string path, Control panel)
        {
            SENavigationTreeNode node = GetNode(path);

            if (node == null)
            {
                Debug.Assert(false, "没有找到路径 " + path);
                throw new Exception();
            }
            node.Panel = panel;
            if (AutoDockFill)
            {
                node.Panel.Dock = DockStyle.Fill;
            }
            return(node);
        }
Exemplo n.º 2
0
        public SENavigationTreeNode AddNode(string path, string name, string text, int imageIndex, Control panel)
        {
            SENavigationTreeNode node = new SENavigationTreeNode();

            if (name != null)
            {
                node.Name = name;
            }
            if (text != null)
            {
                node.Text = text;
            }
            else
            {
                node.Text = name;
            }
            if (panel != null)
            {
                node.Panel = panel;
            }
            if (AutoDockFill)
            {
                node.Panel.Dock = DockStyle.Fill;
            }
            if (path == null || path == String.Empty)
            {
                this.Nodes.Add(node);
            }
            else
            {
                SENavigationTreeNode targetNode = GetNode(path);
                if (targetNode == null)
                {
                    Debug.Assert(false, "没有找到路径 " + path);
                    throw new Exception();
                }
                targetNode.Nodes.Add(node);
            }
            return(node);
        }