Beispiel #1
0
        static void Main(string[] args)
        {
            var observerA = new ConcreteObserverA();
            var observerB = new ConcreteObserverB();
            var subject   = new Subject();

            subject.RegisterObserver(observerA);
            subject.RegisterObserver(observerB);
            subject.NotifyObservers();
            Console.WriteLine("--------------------");
            subject.UnregisterObserver(observerA);
            subject.NotifyObservers();
        }