Beispiel #1
0
 private IDisposable ShouldEnableConnectWhenNotConnected()
 {
     return(_hubState
            .Select(state => state == HubConnectionState.Disconnected)
            .ObserveOn(Schedulers.Dispatcher)
            .Subscribe(_connect));
 }
Beispiel #2
0
 private IDisposable ShouldPopulateNamesWithFilteredNames()
 {
     return(_allNames
            .Select(allNames => _filter.Select(filter => ApplyFilter(filter, allNames)))
            .Switch()
            .Subscribe(_names));
 }
Beispiel #3
0
        private IDisposable ShouldEnableButtonsWhenFaceAvailable()
        {
            var observable = _face
                             .Select(_ => true)
                             .Publish();

            return(new CompositeDisposable(
                       observable.Subscribe(_ian),
                       observable.Subscribe(_rachel),
                       observable.Subscribe(_mia),
                       observable.Subscribe(_max),
                       observable.Subscribe(_alan),
                       observable.Subscribe(_notAFace),
                       observable.Connect()
                       ));
        }
Beispiel #4
0
 private IDisposable ShouldUpdateModeDescriptionWhenIsDualModeChanges()
 {
     return(_isDualMode
            .Select(b => b ? "Running in Dual Screen Mode" : "Running in Single Screen Mode")
            .Subscribe(_modeDescription));
 }
Beispiel #5
0
 private IDisposable ShouldEnableReturnWhenFlightTypeIsReturn()
 {
     return(_flightType
            .Select(flightType => flightType == FlightType.Return)
            .Subscribe(_returnAvailable));
 }
Beispiel #6
0
 private IDisposable ShouldEnableUpdateWhenSelected()
 {
     return(_selected
            .Select(selected => selected.HasValue)
            .Subscribe(_update));
 }
Beispiel #7
0
 private IDisposable ShouldEnableOrDisableAdjustDiameterBasedOnSelectedItem()
 {
     return(_selected
            .Select(selected => selected != null)
            .Subscribe(_adjustDiameter));
 }