protected virtual void PortOnPortDisabled(object sender, EventArgs e) { var port = sender as Port; if (EnabledPorts.Contains(port)) { EnabledPorts.Remove(port); DisabledPorts.Add(port); } else if (ActivePorts.ContainsKey(port)) { ActivePorts.Remove(port); DisabledPorts.Add(port); } }
protected virtual void PortOnPortConnectionEstablished(object sender, ConnectionEstablishedEventArgs e) { var port1 = e.port1; var port2 = e.port2; if (port1 == null || port2 == null) { return; } ActivePorts.Remove(port1); EnabledPorts.Remove(port2); CallingPorts.Add(port1); CallingPorts.Add(port2); var call = new Call(port1.Number, port2.Number); call.Start(); CurrentCalls.Add(call); }