Esempio n. 1
0
        public void SubscriptionStateVisitor_ArgumentChecking()
        {
            Assert.ThrowsException <ArgumentNullException>(() => new SubscriptionStateVisitor(null));

            var s = new SingleAssignmentSubscription();

            Assert.ThrowsException <ArgumentNullException>(() => new SubscriptionStateVisitor(s).LoadState(null));
            Assert.ThrowsException <ArgumentNullException>(() => new SubscriptionStateVisitor(s).SaveState(null));
        }
Esempio n. 2
0
            protected override IEnumerable <ISubscription> OnSubscribe()
            {
                var sub = base.OnSubscribe();

                // return a dummy subscription here, don't subscribe to the observable yet
                // we're not ready at the moment, we'll subscribe when we receive the OnStart notification
                subscription = new SingleAssignmentSubscription();

                return(OnSubscribeCore(sub)); // NB: We don't want OnSubscribe itself to be a lazy iterator.
            }
Esempio n. 3
0
            protected override IEnumerable <ISubscription> OnSubscribe()
            {
                _firstSubscription = new SingleAssignmentSubscription();
                var otherSubscription = new SingleAssignmentSubscription();

                var firstObserver = new FirstObserver(this, _firstSubscription);

                _otherObserver = new OtherObserver(this, firstObserver, otherSubscription);
                _firstSubscription.Subscription = Params._source.Subscribe(firstObserver);
                otherSubscription.Subscription  = Params._other.Take(1).Subscribe(_otherObserver);

                return(new[] { _firstSubscription, otherSubscription });
            }
Esempio n. 4
0
 protected override ISubscription OnSubscribe()
 {
     _subscription = new SingleAssignmentSubscription();
     return(_subscription);
 }