Esempio n. 1
0
        void generateSchemeNodes(List <NetworkNode> networkNodes)
        {
            string previousNodesName = "";

            comboBox1.Items.Add(new ComboboxItem("All", -1));
            for (int i = 0; i < networkNodes.Count; i++)
            {
                SchemeNode sn = new SchemeNode(networkNodes[i]);

                PictureBox cPic   = (PictureBox)this.GetControlByName(this, "p" + sn.getID());
                Label      cLabel = (Label)this.GetControlByName(this, "l" + sn.getID());

                // fill ComboBox
                if (!nodes.ElementAt(i).getName().Equals(previousNodesName))
                {
                    comboBox1.Items.Add(new ComboboxItem(nodes.ElementAt(i).getName(), i));
                }
                try {
                    if (cLabel != null)
                    {
                        sn.setLabel(cLabel);
                        cLabel.Text = "" + sn.getIP();
                        //cLabel.Visible = showIPs;
                        sn.setPic(cPic);
                        cPic.MouseHover += new EventHandler(pictureBoxMouseHoverEventHandler);
                        cPic.MouseLeave += new EventHandler(pictureBoxMouseLeaveEventHandler);
                    }
                } catch (Exception e) {
                    Console.Write("Exception with " + cLabel.Text);
                }
                schemeNodes.Add(sn);
                previousNodesName = nodes.ElementAt(i).getName();
            }
        }
        void generateSchemeNodes(List <NetworkNode> networkNodes)
        {
            for (int i = 0; i < networkNodes.Count; i++)
            {
                SchemeNode sn = new SchemeNode(networkNodes[i]);

                PictureBox cPic   = (PictureBox)this.GetControlByName(this, "p" + sn.getID());
                Label      cLabel = (Label)this.GetControlByName(this, "l" + sn.getID());
                try
                {
                    if (cLabel != null)
                    {
                        sn.setLabel(cLabel);
                        cLabel.Text = "" + sn.getIP();
                        //cLabel.Visible = showIPs;
                        sn.setPic(cPic);
                        cPic.MouseHover += new EventHandler(pictureBoxMouseHoverEventHandler);
                        cPic.MouseLeave += new EventHandler(pictureBoxMouseLeaveEventHandler);
                    }
                }
                catch (Exception e)
                {
                    Console.Write("Exception with " + cLabel.Text);
                }
                setPicToGrey(cPic);
                schemeNodes.Add(sn);
            }
        }
Esempio n. 3
0
 private void updateReport(SchemeNode schNode)
 {
     if (report)
     {
         string curNodeStatus = schNode.getNode().getStatus();
         if (curNodeStatus == "Online")
         {
             schNode.incrementOnline();
         }
         else if (curNodeStatus == "Not Reachable")
         {
             schNode.incrementOffline();
         }
         else if (curNodeStatus == "Timeout")
         {
             schNode.incrementTimeout();
         }
     }
     else
     {
         return;
     }
 }