public void UnregisterListener(IIncidentUpdateListener listener) { if (listener != null) { Console.WriteLine("Unregistering an incident update listener."); _incidentUpdateListeners.TryRemove(listener, out _); } else { Console.WriteLine("Cannot unregister 'null' as incident update listener."); } }
public void RegisterListener(IIncidentUpdateListener listener) { if (listener != null) { Console.WriteLine("Registering a new incident update listener."); _incidentUpdateListeners.TryAdd(listener, 1); } else { Console.WriteLine("Cannot register 'null' as incident update listener."); } }