示例#1
0
 /// <summary>
 /// New LocoIO unit found
 /// </summary>
 void LnStateLocoIoFound(object sender, LocoIOEventArgs e)
 {
     var item = new ListViewItem();
     var entry = e.LocoIO;
     item.Text = entry.Address.ToString();
     item.Tag = entry.Address;
     item.SubItems.Add(entry.Version);
     lbModules.Items.Add(item);
     lbModules.Sort();
     item.Selected = true;
 }
示例#2
0
 private void LnStateLocoIoFound(object sender, LocoIOEventArgs e)
 {
     if (LocoIOFound != null)
     {
         if (ui.InvokeRequired)
         {
             ui.BeginInvoke(new EventHandler<LocoIOEventArgs>(LnStateLocoIoFound), sender, e);
         }
         else
         {
             LocoIOFound.Fire(this, e);
         }
     }
 }