Пример #1
0
        private void ProcessBookingResponse(BookingResult response) {
            if (_ui?.CancellationToken.IsCancellationRequested == true) {
                CancelBooking().Forget();
                return;
            }

            if (response == null) {
                BookingErrorMessage = "Cannot get any response";
                return;
            }

            if (response.IsSuccessful) {
                StartTime = DateTime.Now + response.Left;
                BookingErrorMessage = null;
                IsBooked = response.IsSuccessful;
            } else {
                BookingErrorMessage = response.ErrorMessage;
                IsBooked = false;
            }

            _ui?.OnUpdate(response);
        }
Пример #2
0
        public void OnUpdate(BookingResult response) {
            if (response?.IsSuccessful != true) return;

            Car = ServerEntry.SelectedCarEntry?.CarObject;
            Track = ServerEntry.Track;

            try {
                _ignoreSkinChange = true;
                Skin = ServerEntry.GetSelectedCarSkin();
            } finally {
                _ignoreSkinChange = false;
            }
        }