/// <summary> /// Adds a listener to the Listeners list. /// </summary> /// <param name="newItem">The new Listener to add.</param> public void AddListener(Listener newItem) { if (newItem == null) { throw new ArgumentNullException(); } ListenEntry le = new ListenEntry(); le.listener = newItem; le.guid = Guid.NewGuid(); while (Listeners.Contains(le)) { le.guid = Guid.NewGuid(); } Listeners.Add(le); Console.WriteLine(newItem.ToString() + " started."); }
/// <summary> /// Adds a listener to the Listeners list. /// </summary> /// <param name="newItem">The new Listener to add.</param> public void AddListener(Listener newItem) { if (newItem == null) throw new ArgumentNullException(); ListenEntry le = new ListenEntry(); le.listener = newItem; le.guid = Guid.NewGuid(); while (Listeners.Contains(le)) { le.guid = Guid.NewGuid(); } Listeners.Add(le); Console.WriteLine(newItem.ToString() + " started."); }