public void RemoveListener(IPickerObserver observer) { bool success = _observers.Remove(observer); if (!success) { throw new Exception("Can not remove observer"); } }
public void AddListener(IPickerObserver observer) { bool alreadyExist = _observers.Any(o => o == observer); if (alreadyExist) { throw new Exception("This observer already registered"); } _observers.Add(observer); }