Exemplo n.º 1
0
        public void TestCatch()
        {
            var integer       = new BehaviorSubject <int>(1);
            var intObservable = integer.Catch((Exception e) => Observable.Return <int>(-1));
            var sub           = intObservable.Subscribe(next => Debug.Print("next " + next),
                                                        (Exception e) => Debug.Print("error" + e),
                                                        () => Debug.Print("complete")
                                                        );

            integer.OnNext(5);
            integer.OnNext(4);
            integer.OnCompleted();
        }