public int MethodTwo(IObservable <string> observable) { DisposableTestContainer.Add( observable.Subscribe()); return(1); }
// The returned disposable *should not* be disposed when the class is public IDisposable MethodWithoutObleak() { var disposable = this.WhenAnyValue(x => x.StringProperty).Subscribe(); DisposableTestContainer.Add(disposable); return(disposable); }
public void SubscribeToNewObservableAndCallComplexMethodOne() { DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); // This will call subscrbe within MethodModel and again here on the subject. ComplexMethodOne(); }
public void SingleMethod(IObservable <string> observable) { DisposableTestContainer.Add( observable.Subscribe()); DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); }
public SingleComplexConstructorIheritedFromSingleConstructorThreeSubscribeModel() { var i = 5; DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty, x => x == "Test").Subscribe(_ => i = MultiplyByTwo(i))); StringProperty = "Test"; }
public ComplexClass() { SerialDisposable = new SerialDisposable(); MethodModel = new ThreeMethodsWithMultipleSubscribesModel(); Subject = new Subject <string>(); DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); }
public IDisposable MethodThree() { var disposable = this.WhenAnyValue(x => x.StringProperty).Subscribe(); DisposableTestContainer.Add(disposable); DisposableTestContainer.Add( Observable.FromAsync(_ => Task.FromResult(true)).Subscribe()); return(disposable); }
public SingleConstructorThreeSubscribesModel() { DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); DisposableTestContainer.Add( Observable.FromAsync(_ => Task.FromResult(true)).Subscribe()); DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); }
public void ComplexMethodOne() { var disposable = MethodModel.MethodThree(); SerialDisposable.Disposable = disposable; // First Disposable DisposableTestContainer.Add( Subject .StartWith("TestString") .ObserveOn(RxApp.MainThreadScheduler) .Subscribe(_ => { // Second disposable; note the StartWith meaning the subject doesn't have to fire for this to be hit MethodOne(); _intValue = MultiplyByTwo(73); }, exception => { }, () => _intValue = MultiplyByTwo(_intValue))); // Third disposable DisposableTestContainer.Add(disposable); }
public void MethodOne() { DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); }
public TwoConstructorsOnlyOneWithObleakAttributeModel(bool a) { DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); }
public TwoConstructorsSingleSubscribeModel(bool b) { DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); }
public void FireSubjectAndSubscribeToNewObservable() { Subject.OnNext("Yes"); DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); }
public void MethodOne() { DisposableTestContainer.Add( Observable.FromAsync(_ => Task.FromResult(true)).Subscribe()); }
public ClassSingleConstructorTwoMethods() { DisposableTestContainer.Add( this.WhenAnyValue(x => x.StringProperty).Subscribe()); }