예제 #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);
 }