Exemplo n.º 1
0
        public ShengNavigationTreeNode AddNode(string path, string name, string text, int imageIndex, Control panel)
        {
            ShengNavigationTreeNode node = new ShengNavigationTreeNode();

            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
            {
                ShengNavigationTreeNode targetNode = GetNode(path);
                if (targetNode == null)
                {
                    Debug.Assert(false, "没有找到路径 " + path);
                    throw new Exception();
                }
                targetNode.Nodes.Add(node);
            }

            return(node);
        }
Exemplo n.º 2
0
        public ShengNavigationTreeNode SetPanel(string path, Control panel)
        {
            ShengNavigationTreeNode 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);
        }