// This methods allows classes to unregister for LearningEvents public virtual void removeListener(LearningEventListener listener) { lock (this) { if (listener == null) { throw new System.ArgumentException("listener is null!"); } listeners.Remove(listener); } }
// This methods allows classes to register for LearningEvents public virtual void addListener(LearningEventListener listener) { lock (this) { if (listener == null) { throw new System.ArgumentException("listener is null!"); } if (!listeners.Contains(listener)) { listeners.Add(listener); } } }