예제 #1
0
        private static void TraditionalObserver()
        {
            var               subj = new TraditionalObs.StockTicker();
            GoogleObserver    gobs = new GoogleObserver(subj);
            MicrosoftObserver mobs = new MicrosoftObserver(subj);

            foreach (var s in SampleData.getNext())
            {
                subj.Stock = s;
            }
        }
예제 #2
0
 public GoogleObserver(StockTicker subject)
 {
     this.DataSource = subject;
     subject.Register(this);
 }
 public MicrosoftObserver(StockTicker subject)
 {
     this.DataSource = subject;
     subject.Register(this);
 }