예제 #1
0
        private void SelectionChanged()
        {
            TreeNode node = mainTreeView.SelectedNode;

            if (node == this.deviceNode && this.deviceNode != null)
            {
                programButton.Enabled        = true;
                verifyButton.Enabled         = true;
                eraseButton.Enabled          = true;
                exitBootloaderButton.Enabled = true;
            }
            else
            {
                programButton.Enabled        = false;
                verifyButton.Enabled         = false;
                eraseButton.Enabled          = false;
                exitBootloaderButton.Enabled = false;
            }

            splitContainer1.Panel2.Controls.Clear();
            UserControl mainPanel = null;

            if (node == null)
            {
                mainPanel = new NullPanel();
            }
            else if (node == this.deviceNode)
            {
                mainPanel = new LokiPanel((LokiInfo)node.Tag);
            }
            else
            {
                mainPanel = new PlankPanel((BoardInfo)node.Tag);
            }
            mainPanel.Dock = DockStyle.Fill;
            splitContainer1.Panel2.Controls.Add(mainPanel);
        }
예제 #2
0
        private void SelectionChanged()
        {
            TreeNode node = mainTreeView.SelectedNode;
            if (node == this.deviceNode && this.deviceNode != null)
            {
                programButton.Enabled = true;
                verifyButton.Enabled = true;
                eraseButton.Enabled = true;
                exitBootloaderButton.Enabled = true;
            }
            else
            {
                programButton.Enabled = false;
                verifyButton.Enabled = false;
                eraseButton.Enabled = false;
                exitBootloaderButton.Enabled = false;
            }

            splitContainer1.Panel2.Controls.Clear();
            UserControl mainPanel = null;
            if(node == null) {
                mainPanel = new NullPanel();
            }
            else if (node == this.deviceNode)
            {
                mainPanel = new LokiPanel((LokiInfo)node.Tag);
            }
            else
            {
                mainPanel = new PlankPanel((BoardInfo)node.Tag);
            }
            mainPanel.Dock = DockStyle.Fill;
            splitContainer1.Panel2.Controls.Add(mainPanel);
        }