예제 #1
0
        private static void ObserverPattern()
        {
            var location = new MagLocation();
               var mag1 = new People("Observer_1", location);
               var mag2 = new People("Observer_2", location);

               location.Attach(mag1);
               location.Attach(mag2);
               location.State = "HighWay Street";
        }
예제 #2
0
 public People(string street, MagLocation magLocation)
 {
     _magLocation = magLocation;
        _street = street;
 }