示例#1
0
 public void nodeStringSet(BaseNode n)
 {
     if (this.InvokeRequired)
     {
         dElegateNode d = new dElegateNode(changeNode);
         this.Invoke(d, new object[] { n });
     }
     else
     {
         if (n.Tag == null)
         {
             throw new Exception("Node dose not have a tag");
         }
         Button b = (Button)n.Tag;
         b.Text = getNodeString(n);
         if (n.Addr >= 100)
         {
             b.ForeColor = support.Color_red;
         }
         else
         {
             b.ForeColor = support.Color_dank;
         }
         this.NodeTipTT.SetToolTip(b, n.ToolTip());
     }
 }
示例#2
0
 public void nodeStringSet(Node n)
 {
     if (this.InvokeRequired)
     {
         dElegateNode d = new dElegateNode(nodeStringSet);
         this.Invoke(d, new object[] { n });
     }
     else
     {
         if (n.Tag == null)
         {
             throw new Exception("Node dose not have a tag");
         }
         Button b = (Button)n.Tag;
         b.Text = n.getAddrName();
         if (n.Is_in_update)
         {
             b.ForeColor = support.Color_navy;
         }
         else
         {
             if (n.Addr >= 100)
             {
                 b.ForeColor = support.Color_red;
             }
             else
             {
                 b.ForeColor = support.Color_dank;
             }
         }
         this.NodeTipTT.SetToolTip(b, n.GetToolTip());
     }
 }
示例#3
0
 public void removeNode(BaseNode n)
 {
     if (this.InvokeRequired)
     {
         dElegateNode d = new dElegateNode(removeNode);
         this.Invoke(d, new object[] { n });
     }
     else
     {
         if (n.Tag == null)
         {
             throw new Exception("Node dose not have tag!");
         }
         Button b = (Button)n.Tag;
         this.nodesTable.Controls.Remove(b);
     }
 }
示例#4
0
 public void changeNode(BaseNode n)
 {
     if (this.InvokeRequired)
     {
         dElegateNode d = new dElegateNode(changeNode);
         this.Invoke(d, new object[] { n });
     }
     else
     {
         if (n.Tag == null)
         {
             throw new Exception("Node dose not have a tag");
         }
         Button b = (Button)n.Tag;
         b.Tag = n;
         nodeButtonSet(b);
     }
 }
示例#5
0
 public void addNode(BaseNode n)
 {
     if (this.InvokeRequired)
     {
         dElegateNode d = new dElegateNode(addNode);
         this.Invoke(d, new object[] { n });
     }
     else
     {
         if (n.Tag != null)
         {
             throw new Exception("node has Tag");
         }
         Button b = new Button();
         n.Tag = b;
         b.Tag = n;
         nodeButtonSet(b);
         this.nodesTable.Controls.Add(b);
     }
 }
示例#6
0
 public void addNode(Node n)
 {
     if (this.InvokeRequired)
     {
         dElegateNode d = new dElegateNode(addNode);
         this.Invoke(d, new object[] { n });
     }
     else
     {
         if (n.Tag != null)
         {
             throw new ArgumentException("Node has a tag, which means this node is display by other Form", n.ToString());
         }
         Button b = new Button();
         n.Tag = b;
         b.Tag = n;
         nodeButtonSet(b);
         this.nodesTable.Controls.Add(b);
         n.eChangeDescription += new dNodeUpdateEvent(nodeStringSet);
         n.eDispossing        += new dNodeUpdateEvent(removeNode);
     }
 }