コード例 #1
0
        public IObservable <int> ObserveCountChanged(bool notifyCurrentCount = false)
        {
            if (isDisposed)
            {
                return(Observable.Empty <int>());
            }

            Subject <int> subject = countChanged ?? (countChanged = new Subject <int>());

            if (notifyCurrentCount)
            {
                return(subject.StartWith(() => this.Count));
            }
            else
            {
                return(subject);
            }
        }
コード例 #2
0
        public IObservable <int> ObserveCountChanged(bool notifyCurrentCount = false)
        {
            if (this.isDisposed)
            {
                return(Observable.Empty <int>());
            }
            Subject <int> subject;

            if ((subject = this.countChanged) == null)
            {
                subject = (this.countChanged = new Subject <int>());
            }
            Subject <int> subject2 = subject;

            if (notifyCurrentCount)
            {
                return(subject2.StartWith(new Func <int>(base.get_Count)));
            }
            return(subject2);
        }