Beispiel #1
0
        private static void Main()
        {
            Observable        observable        = new Observable();
            AnotherObservable anotherObservable = new AnotherObservable();

            using (Observer observer = new Observer(observable))
            {
                observable.DoSomething();
                observer.Add(anotherObservable);
                anotherObservable.DoSomething();
            }

            Console.ReadLine();
        }
        private static void MainProgram()
        {
            var observable        = new Observable();
            var anotherObservable = new AnotherObservable();

            using (IObserver observer = new Observer(observable))
            {
                observable.DoSomething();
                observer.Add(anotherObservable);
                anotherObservable.DoSomething();
            }

            Console.ReadLine();
        }