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