Пример #1
0
        private void SyncPanelControls(JORNode node)
        {
            GroupBox panel = ControlPanel;

            if (panel.Controls.Count > 0)
            {
                var jorPanel = panel.Controls[0] as JORPanel;
                jorPanel.Destroy();
            }

            panel.Controls.Clear();
            if (jorServer != null && node != null)
            {
                if (node.Status == JORNodeStatus.GenRequestSent)
                {
                    // If we haven't received a GenRequest response, it might have gotten stuck. Poke it again.
                    jorServer.SendGenObjectInfo(node);
                }

                var jorPanel = new JORPanel(jorServer, node, stringDictionary);

                jorPanel.Dock = DockStyle.Fill;
                panel.Controls.Add(jorPanel);
            }
        }
Пример #2
0
        private void NodeUpdated(JORNode jorNode)
        {
            if (ControlPanel.Controls.Count > 0)
            {
                JORPanel panel = ControlPanel.Controls[0] as JORPanel;
                if (jorNode == panel.Node)
                {
                    SyncPanelControls(jorNode);
                }
            }

            if (this.treeView1.Nodes.Count > 0)
            {
                var treeNode = FindTreeNodeForJORNode(jorNode, this.treeView1.Nodes[0]);
                if (treeNode != null)
                {
                    SyncTreeNode(treeNode, jorNode);
                }
            }
            else if (jorNode == this.jorServer.Root.TreeRoot)
            {
                SyncTree();
            }
        }