Пример #1
0
 private void DetachObserver(Button button, BaseObserverView observer)
 {
     if (button.Text.Equals("Detach"))
     {
         subject.Detach(observer);
         button.Text = "Attach";
     }
     else
     {
         subject.Attach(observer);
         button.Text = "Detach";
     }
 }
Пример #2
0
 public void Attach(BaseObserverView observer)
 {
     observers.Add(observer);
 }
Пример #3
0
 public void Detach(BaseObserverView observer)
 {
     observers.Remove(observer);
 }