コード例 #1
0
        public void Subscribe(ICompletableSubscriber s)
        {
            var oo = new OtherObserver(s, source);

            s.OnSubscribe(oo);

            oo.SetResource(other.Subscribe(oo));
        }
コード例 #2
0
        public Demo()
        {
            var boss          = new Boss();
            var stockObserver = new StockObserver("小魏", boss);
            var nbaObserver   = new NbaObserver("小易", boss);
            var otherObserver = new OtherObserver();

            boss.Update += stockObserver.CloseStockMarket;
            boss.Update += nbaObserver.CloseNbaDirectSeeding;
            boss.Update += otherObserver.Other;

            boss.SubjectState = "我胡汉三回来了";
            //boss.Update -= stockObserver.CloseStockMarket;
            boss.Notify();
        }
コード例 #3
0
            public IDisposable Run(SkipUntil <TSource, TOther> parent)
            {
                var sourceObserver = new SourceObserver(this);
                var otherObserver  = new OtherObserver(this, sourceObserver);

                var otherSubscription  = parent._other.SubscribeSafe(otherObserver);
                var sourceSubscription = parent._source.SubscribeSafe(sourceObserver);

                sourceObserver.Disposable = sourceSubscription;
                otherObserver.Disposable  = otherSubscription;

                return(StableCompositeDisposable.Create(
                           sourceSubscription,
                           otherSubscription
                           ));
            }
コード例 #4
0
            public IDisposable Run(TakeUntil <TSource, TOther> parent)
            {
                var sourceObserver = new SourceObserver(this);
                var otherObserver  = new OtherObserver(this, sourceObserver);

                // COMPAT - Order of Subscribe calls per v1.0.10621
                var otherSubscription = parent._other.SubscribeSafe(otherObserver);

                otherObserver.Disposable = otherSubscription;

                var sourceSubscription = parent._source.SubscribeSafe(sourceObserver);

                return(StableCompositeDisposable.Create(
                           otherSubscription,
                           sourceSubscription
                           ));
            }
コード例 #5
0
 public TakeUntilObserver(ICompletableObserver downstream)
 {
     this.downstream = downstream;
     this.other      = new OtherObserver(this);
 }
コード例 #6
0
 public TakeUntilObserver(IMaybeObserver <T> downstream)
 {
     this.downstream = downstream;
     this.other      = new OtherObserver(this);
 }
コード例 #7
0
 public TakeUntilMainObserver(ISignalObserver <T> downstream)
 {
     this.downstream = downstream;
     this.other      = new OtherObserver(this);
 }
 public MainObserver(ISignalObserver <T> downstream, IObservableSource <T> source)
 {
     this.downstream = downstream;
     this.other      = new OtherObserver(this, source);
 }