Beispiel #1
0
 public void Do()
 {
     ConcreteSubject subject = new ConcreteSubject("0.10");
     subject.Attach(new ConcreteObserver("X"));
     subject.State = "state1";
     subject.Price = "0.01";
     Console.ReadLine();
 }
 public ConcreteObserver(ConcreteSubject subject)
 {
     this._subject = subject;
 }
 public ConcreteObserver(string observerId, ISubject subject)
 {
     ObserverId = observerId;
     Subject    = (ConcreteSubject)subject;
 }