Esempio n. 1
0
 private void treeView_AfterSelect(object sender, TreeViewEventArgs e)
 {
     btnRemove.Enabled = (e.Node is RootTreeNode);
     if (e.Node is ServerTreeNode)
     {
         ServerTreeNode node = e.Node as ServerTreeNode;
         OnServerClicked(new ServerClickedEventArgs(node.Root, node.Text));
     }
     else if (e.Node is StandalonePluginTreeNode)
     {
         StandalonePluginTreeNode node = e.Node as StandalonePluginTreeNode;
         OnStandalonePluginClicked(new StandalonePluginClickedEventArgs(node.Root, node.Text));
     }
     else if (e.Node is ServerPluginTreeNode)
     {
         ServerPluginTreeNode node = e.Node as ServerPluginTreeNode;
         OnServerPluginClicked(new ServerPluginClickedEventArgs(node.Root, node.ServerName, node.Text));
     }
     else if (e.Node is SecurityManagerTreeNode)
     {
         SecurityManagerTreeNode node = e.Node as SecurityManagerTreeNode;
         OnSecurityManagerClicked(new SecurityManagerClickedEventArgs(node.Root));
     }
     else if (e.Node is RootTreeNode)
     {
         RootTreeNode node = e.Node as RootTreeNode;
         OnRootClicked(new RootClickedEventArgs(node.Root));
     }
 }
Esempio n. 2
0
        public override void RefreshView()
        {
            List <string> servers = new List <string>(Root.Servers);
            List <string> plugins = new List <string>(Root.Plugins);

            foreach (ServerTreeNode node in ServersNode.Nodes)
            {
                if (!servers.Contains(node.Text))
                {
                    ServersNode.Nodes.Remove(node);
                }
            }
            foreach (StandalonePluginTreeNode node in PluginsNode.Nodes)
            {
                if (!plugins.Contains(node.Text))
                {
                    PluginsNode.Nodes.Remove(node);
                }
            }
            foreach (string server in servers)
            {
                ServerTreeNode serverNode = null;

                foreach (ServerTreeNode node in ServersNode.Nodes)
                {
                    if (node.Text == server)
                    {
                        serverNode = node;
                    }
                }

                if (serverNode == null)
                {
                    serverNode = new ServerTreeNode(Root, server);
                    ServersNode.Nodes.Add(serverNode);
                }
                serverNode.RefreshView();
            }
            foreach (string plugin in plugins)
            {
                StandalonePluginTreeNode pluginNode = null;

                foreach (StandalonePluginTreeNode node in PluginsNode.Nodes)
                {
                    if (node.Text == plugin)
                    {
                        pluginNode = node;
                    }
                }

                if (pluginNode == null)
                {
                    pluginNode = new StandalonePluginTreeNode(Root, plugin);
                    PluginsNode.Nodes.Add(pluginNode);
                }
                pluginNode.RefreshView();
            }
        }
Esempio n. 3
0
        public override void RefreshView()
        {
            List<string> servers = new List<string>(Root.Servers);
            List<string> plugins = new List<string>(Root.Plugins);

            foreach (ServerTreeNode node in ServersNode.Nodes)
            {
                if (!servers.Contains(node.Text))
                    ServersNode.Nodes.Remove(node);
            }
            foreach (StandalonePluginTreeNode node in PluginsNode.Nodes)
            {
                if (!plugins.Contains(node.Text))
                    PluginsNode.Nodes.Remove(node);
            }
            foreach (string server in servers)
            {
                ServerTreeNode serverNode = null;

                foreach (ServerTreeNode node in ServersNode.Nodes)
                {
                    if (node.Text == server)
                        serverNode = node;
                }

                if (serverNode == null)
                {
                    serverNode = new ServerTreeNode(Root, server);
                    ServersNode.Nodes.Add(serverNode);
                }
                serverNode.RefreshView();
            }
            foreach (string plugin in plugins)
            {
                StandalonePluginTreeNode pluginNode = null;

                foreach (StandalonePluginTreeNode node in PluginsNode.Nodes)
                {
                    if (node.Text == plugin)
                        pluginNode = node;
                }

                if (pluginNode == null)
                {
                    pluginNode = new StandalonePluginTreeNode(Root, plugin);
                    PluginsNode.Nodes.Add(pluginNode);
                }
                pluginNode.RefreshView();
            }
        }