示例#1
0
 void form_OnTcpClientAdded(TcpSettings settings)
 {
     if (this.OnTcpClientAdded != null)
     {
         if (root.Nodes.ContainsKey(settings.name)) //port names cannot be duplicates
         {
             MessageBox.Show("A port with that name already exists: " + settings.name);
         }
         else
         {
             this.OnTcpClientAdded(settings);
             TreeNode     node             = this.root.Nodes.Add(settings.name, settings.name);
             EventHandler addMasterAction  = (obj, e) => this.AddMasterClick(node);
             EventHandler removePortAction = (obj, e) => this.RemovePortClick(node);
             node.ContextMenuStrip = this.WireNewPortMenuStrip(addMasterAction, removePortAction);
             node.ToolTipText      = settings.ToString();
         }
     }
 }
示例#2
0
 private void stackBrowser1_OnTcpServerAdded(TcpSettings s)
 {
     sm.AddTCPServer(s.name, s.level, s.timeout, s.address, s.port);
 }
 private void stackBrowser1_OnTcpClientAdded(TcpSettings s)
 {
     sm.AddTCPv4Client(s.name, s.level, s.timeout, s.address, s.port);
 }
示例#4
0
 void form_OnTcpClientAdded(TcpSettings settings)
 {
     if (this.OnTcpClientAdded != null)
     {
         if (root.Nodes.ContainsKey(settings.name)) //port names cannot be duplicates
         {
             MessageBox.Show("A port with that name already exists: " + settings.name);
         }
         else
         {
             this.OnTcpClientAdded(settings);
             TreeNode node = this.root.Nodes.Add(settings.name, settings.name);
             EventHandler addMasterAction = (obj, e) => this.AddMasterClick(node);
             EventHandler removePortAction = (obj, e) => this.RemovePortClick(node);
             node.ContextMenuStrip = this.WireNewPortMenuStrip(addMasterAction, removePortAction);
             node.ToolTipText = settings.ToString();
         }
     }
 }