Ejemplo n.º 1
0
        public ObserversViaSpecialInterfaces()
        {
            var person = new Person2();

            //IDisposable sub = person.Subscribe(this);

            // Reactive Extensions event.
            person.OfType <FallsIllEvent>().Subscribe(args =>
                                                      Console.WriteLine($"A doctor is required at {args.Address}"));

            person.FallsIll();
        }
Ejemplo n.º 2
0
 public Subscription(Person2 person, IObserver <Event> observer)
 {
     _person  = person;
     Observer = observer;
 }