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); } }
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); }