/// <summary>
 /// Removes a news reader from section's reader list.
 /// </summary>
 /// <param name="reader">News reader.</param>
 public void RemoveReader(INewsObserver reader)
 {
     Change -= reader.Notify;
     Console.WriteLine($"{reader.Name} removed from {Name} section's reader list.\n");
 }
 /// <summary>
 /// Registers a news reader as a section's reader.
 /// </summary>
 /// <param name="reader">News reader.</param>
 public void RegisterReader(INewsObserver reader)
 {
     Change += reader.Notify;
     Console.WriteLine($"{reader.Name} registered as a {Name} section's reader.\n");
 }
Beispiel #3
0
 public void DetachObserver(INewsObserver observer)
 {
     _observers.Remove(observer);
 }
Beispiel #4
0
 public void AttachObserver(INewsObserver observer)
 {
     _observers.Add(observer);
 }
 public void AddObserver(INewsObserver observer)
 {
     _newsObservers.Add(observer);
 }
 public void RemoveObserver(INewsObserver observer)
 {
     _newsObservers.Remove(observer);
 }