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()); } }
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()); } }
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); } }
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); } }
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); } }
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); } }