示例#1
0
        public void RefreshConnectionsNode()
        {
            this.ConnectionsNode.Nodes.Clear();
            this.ConnectionsNode.ContextMenu = new ContextMenu(new MenuItem[]
            {
                new MenuItem("New Connection...", new EventHandler(NewConnectionMenuItem_Click))
            });

            if (!this.Project.Connections.IsNullOrEmpty())
            {
                foreach (var connectionInfo in this.Project.Connections.OrderBy(o => o.Name))
                {
                    ConnectionTreeNode node = new ConnectionTreeNode(this, connectionInfo);

                    node.DeleteClicked += ConnectionNode_DeleteClicked;

                    this.ConnectionsNode.Nodes.Add(node);
                }
            }

            this.ConnectionsNode.Expand();
        }
        public void RefreshConnectionsNode()
        {
            this.ConnectionsNode.Nodes.Clear();
            this.ConnectionsNode.ContextMenu = new ContextMenu(new MenuItem[]
            {
                new MenuItem("New Connection...",  new EventHandler(NewConnectionMenuItem_Click))
            });

            if (!this.Project.Connections.IsNullOrEmpty())
            {
                foreach (var connectionInfo in this.Project.Connections.OrderBy(o => o.Name))
                {
                    ConnectionTreeNode node = new ConnectionTreeNode(this, connectionInfo);

                    node.DeleteClicked += ConnectionNode_DeleteClicked;

                    this.ConnectionsNode.Nodes.Add(node);
                }
            }

            this.ConnectionsNode.Expand();
        }