protected new void TransitionTo(Ridesharing.StateBase next) { foreach (var listener in statusListeners) { OnStatusUpdated -= listener; } base.TransitionTo(next); }
void HandleRidesStateChanged(Ridesharing.StateBase newState) { bool isMatched = false; PendingRideStatus pendingRideStatus = null; Func <Task <bool> > confirm = null; Func <Task <bool> > decline = null; //TODO ick... HomeView hPage = ((homePage as NavigationPage).RootPage as ContentPage).Content as HomeView; switch (newState) { case AbstractMatchedState matchedState: isMatched = true; confirm = matchedState.Confirm; decline = matchedState.Decline; pendingRideStatus = matchedState.MostRecentStatus; break; case RideInProgressState rideInProgressState: // TODO: Compute route to display. break; } if (isMatched) { async Task ShowConfirmView() { ShowHomePage(); await(homePage as NavigationPage).PopToRootAsync(); hPage.ShowConfirmView(confirm, decline, pendingRideStatus); } Device.BeginInvokeOnMainThread(() => ShowConfirmView().FireAndForgetAsync(App.Current.ErrorHandler)); } }
public OfferMatchedState(Ridesharing.StateBase previous, IMatchedRideRelatedRequest match) : base(previous, match) { }
public OfferPendingState(Ridesharing.StateBase previous, IPendingRideRelatedRequest response, RideOffer offer) : base(previous, response) { Offer = offer; }
public UnknownState(Ridesharing.StateBase previous) : base(previous) { }
protected new void TransitionTo(Ridesharing.StateBase next) { UnregisterListeners(); base.TransitionTo(next); }
protected AbstractPendingState(Ridesharing.StateBase previous, IPendingRideRelatedRequest response) : base(previous) { this.response = response; }
public WaitingForConfirmedState(Ridesharing.StateBase previous, IMatchedRideRelatedRequest match) : base(previous) { this.match = match; }
public RideInProgressState(Ridesharing.StateBase previous, ActiveRideStatus rideStatus) : base(previous) { MostRecentRideStatus = rideStatus; }
public RequestPendingState(Ridesharing.StateBase previous, IPendingRideRelatedRequest response, RideRequest request) : base(previous, response) { Request = request; }
protected AbstractMatchedState(Ridesharing.StateBase previous, IMatchedRideRelatedRequest match) : base(previous) { this.match = match; }
public NoneState(Ridesharing.StateBase previous) : base(previous) { }