コード例 #1
0
        public void TestCase1()
        {
            var subject = new ConcreteSubject();
              subject.Attach(new ConcreteObserver("Observer 1", subject));
              subject.Attach(new ConcreteObserver("Observer 2", subject));
              subject.Attach(new ConcreteObserver("Observer 3", subject));

              subject.State = "Hello World";
        }
コード例 #2
0
 public ConcreteObserver(string name, ConcreteSubject subject)
 {
     Name     = name;
     _subject = subject;
 }
コード例 #3
0
 public ConcreteObserver(string name, ConcreteSubject subject)
 {
     Name = name;
       _subject = subject;
 }