Ejemplo 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));
     }
 }
Ejemplo n.º 2
0
        public override void RefreshView()
        {
            List <string> plugins = new List <string>(Server.Plugins);

            foreach (ServerPluginTreeNode node in Nodes)
            {
                if (!plugins.Contains(node.Text))
                {
                    Nodes.Remove(node);
                }
            }
            foreach (string plugin in plugins)
            {
                ServerPluginTreeNode pluginNode = null;
                foreach (ServerPluginTreeNode node in Nodes)
                {
                    if (node.Text == plugin)
                    {
                        pluginNode = node;
                    }
                }

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

            switch (Server.ServerStatus)
            {
            case SC.Interfaces.ServerConstants.ServerStatus.Started:
                BackColor = Color.DarkGreen; break;

            case SC.Interfaces.ServerConstants.ServerStatus.Starting:
                BackColor = Color.Orange; break;

            case SC.Interfaces.ServerConstants.ServerStatus.Stopped:
                BackColor = Color.Red; break;

            default:
                BackColor = Color.White; break;
            }
        }
Ejemplo n.º 3
0
        public override void RefreshView()
        {
            List<string> plugins = new List<string>(Server.Plugins);

            foreach (ServerPluginTreeNode node in Nodes)
            {
                if (!plugins.Contains(node.Text))
                    Nodes.Remove(node);
            }
            foreach (string plugin in plugins)
            {
                ServerPluginTreeNode pluginNode = null;
                foreach (ServerPluginTreeNode node in Nodes)
                {
                    if (node.Text == plugin)
                        pluginNode = node;
                }

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

            switch (Server.ServerStatus)
            {
                case SC.Interfaces.ServerConstants.ServerStatus.Started:
                    BackColor = Color.DarkGreen; break;
                case SC.Interfaces.ServerConstants.ServerStatus.Starting:
                    BackColor = Color.Orange; break;
                case SC.Interfaces.ServerConstants.ServerStatus.Stopped:
                    BackColor = Color.Red; break;
                default:
                    BackColor = Color.White; break;
            }
        }