예제 #1
0
 private void ConnectedPorts_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Add)
     {
         PortConnected?.Invoke(sender, sender as IPort);
     }
     else if (e.Action == NotifyCollectionChangedAction.Remove)
     {
         PortDisconnected?.Invoke(sender, sender as IPort);
     }
 }
예제 #2
0
 private void OnPortConnected()
 {
     PortConnected?.Invoke(this, EventArgs.Empty);
 }
예제 #3
0
 void IHandle <PortConnected> .Handle(PortConnected message)
 {
     addBatteryToolStripMenuItem.Enabled = true;
     clusterToolStripMenuItem.Enabled    = true;
 }
예제 #4
0
 /// <summary>
 /// Подключить терминал к порту
 /// </summary>
 /// <param name="terminal"></param>
 internal void ConnectTerminal(ITerminal terminal)
 {
     PortConnected?.Invoke(this, new PortEventArgs($"Port №{PortNumber}:  Терминал {terminal.Name} подключен к порту с абон. номером {AbonentNumber}"));
 }