/// <summary> /// Loads the listeners list from an XML file. /// </summary> /// <param name="reader">The XML reader to read the users from.</param> private void LoadListeners(XmlTextReader reader) { // Read until we reach the Listeners element end tag Listener listener = null; while (reader.Read() && reader.Name.ToLower() != "listeners") { if (reader.Name != null && reader["value"] != null && reader["type"] != null) { listener = Parent.CreateListener(reader["type"], reader["value"]); if (listener != null) { try { listener.Start(); } catch {} Parent.AddListener(listener); } } } }
private void AddListener(Guid id, Listener newItem) { if (newItem == null) throw new ArgumentNullException(); listeners[id] = newItem; OnListenerStarted(new ListenerEventArgs {Listener = newItem}); newItem.Start(); }