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 PortOnPortStateSetToActive(object sender, CallEventArgs phoneNumberArgs) { var port = sender as Port; if (DisabledPorts.Contains(port)) { DisabledPorts.Remove(port); ActivePorts.Add(port, phoneNumberArgs.number); } if (EnabledPorts.Contains(port)) { EnabledPorts.Remove(port); ActivePorts.Add(port, phoneNumberArgs.number); } CheckActivePortCalledNumber(port, phoneNumberArgs.number); }
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); }