Version 3.0.337

This commit is contained in:
Anja Müller-Meißner 2022-08-30 15:42:25 +02:00
parent fd0e63cf10
commit 573fe77e12
2336 changed files with 33688 additions and 86082 deletions

View file

@ -5,7 +5,7 @@ using TINK.Model.Device;
using TINK.Model.User;
using TINK.View;
using TINK.ViewModel.Bikes.Bike.BC.RequestHandler;
using BikeInfoMutable = TINK.Model.Bike.BC.BikeInfoMutable;
using BikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable;
namespace TINK.ViewModel.Bikes.Bike.BC
{
@ -73,7 +73,7 @@ namespace TINK.ViewModel.Bikes.Bike.BC
/// Todo: Check which events are received here and filter, to avoid event storm.
/// </summary>
/// <param name="p_strNameOfProp"></param>
public override void OnSelectedBikeStateChanged ()
public override void OnSelectedBikeStateChanged()
{
RequestHandler = RequestHandlerFactory.Create(
Bike,

View file

@ -1,7 +1,6 @@
using System;
using TINK.Model.Connector;
using TINK.Model.Device;
using TINK.Model.State;
using TINK.Model.User;
using TINK.View;
@ -14,9 +13,6 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
/// </summary>
public IBikesViewModel BikesViewModel { get; set; }
/// <summary> Gets the bike state. </summary>
public abstract InUseStateEnum State { get; }
/// <summary>
/// Gets a value indicating whether the button to reserve bike is visible or not.
/// </summary>
@ -54,7 +50,7 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
private bool isConnected;
/// <summary>Gets the is connected state. </summary>
public bool IsConnected
public bool IsConnected
{
get => isConnected;
set

View file

@ -1,8 +1,7 @@
using Serilog;
using System;
using System;
using System.Threading.Tasks;
using TINK.Model.Bikes.Bike.BC;
using TINK.Model.State;
using Serilog;
using TINK.Model.Bikes.BikeInfoNS.BC;
using TINK.Model.User;
using TINK.MultilingualResources;
using TINK.View;
@ -11,9 +10,6 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
{
public class Booked : IRequestHandler
{
/// <summary> Gets the bike state. </summary>
public InUseStateEnum State => InUseStateEnum.Booked;
/// <summary>
/// If a bike is booked unbooking can not be done by though app.
/// </summary>

View file

@ -1,15 +1,14 @@
using Serilog;
using System;
using System;
using System.Threading.Tasks;
using Serilog;
using TINK.Model.Connector;
using TINK.Repository.Exception;
using TINK.Model.Device;
using TINK.Model.State;
using TINK.Model.User;
using TINK.MultilingualResources;
using TINK.Repository.Exception;
using TINK.View;
using BikeInfoMutable = TINK.Model.Bike.BC.BikeInfoMutable;
using TINK.Model.Device;
using BikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable;
namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
{
@ -28,10 +27,6 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
IUser activeUser) : base(selectedBike, selectedBike.State.Value.GetActionText(), true, isConnectedDelegate, connectorFactory, viewUpdateManager, smartDevice, viewService, bikesViewModel, activeUser)
{
}
/// <summary> Gets the bike state. </summary>
public override InUseStateEnum State => InUseStateEnum.Disposable;
/// <summary> Request bike. </summary>
public async Task<IRequestHandler> HandleRequest()
{
@ -84,16 +79,16 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
BikesViewModel.ActionText = string.Empty;
await ViewService.DisplayAlert(
"Verbingungsfehler beim Reservieren des Rads!",
AppResources.MessageReservingBikeErrorConnectionTitle,
string.Format("{0}\r\n{1}", l_oException.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons),
"OK");
AppResources.MessageAnswerOk);
}
else
{
Log.ForContext<Disposable>().Error("User selected availalbe bike {l_oId} but reserving failed. {@l_oException}", SelectedBike.Id, l_oException);
BikesViewModel.ActionText = string.Empty;
await ViewService.DisplayAlert("Fehler beim Reservieren des Rads!", l_oException.Message, "OK");
await ViewService.DisplayAlert(AppResources.MessageReservingBikeErrorGeneralTitle, l_oException.Message, AppResources.MessageAnswerOk);
}
BikesViewModel.ActionText = string.Empty; // Todo: Remove this statement because in catch block ActionText is already set to empty above.

View file

@ -1,6 +1,6 @@
using Serilog;
using System;
using System;
using System.Threading.Tasks;
using Serilog;
using TINK.Model.State;
using TINK.Model.User;
using TINK.View;
@ -16,19 +16,18 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
IBikesViewModel bikesViewModel,
IUser activeUser)
{
State = state;
ButtonText = state.GetActionText();
IsIdle = true;
ViewService = viewService;
BikesViewModel = bikesViewModel
?? throw new ArgumentException($"Can not construct {GetType().Name}-object. {nameof(bikesViewModel)} must not be null.");
}
public InUseStateEnum State { get; }
public bool IsButtonVisible => true;
public bool IsIdle { get; private set; }
public string ButtonText => State.GetActionText();
public string ButtonText { get; private set; }
public string ActionText { get => BikesViewModel.ActionText; private set => BikesViewModel.ActionText = value; }

View file

@ -1,15 +1,13 @@
using Serilog;
using System;
using System;
using System.Threading.Tasks;
using Serilog;
using TINK.Model.Connector;
using TINK.Repository.Exception;
using TINK.Model.State;
using TINK.Model.Device;
using TINK.Model.User;
using TINK.MultilingualResources;
using TINK.Repository.Exception;
using TINK.View;
using BikeInfoMutable = TINK.Model.Bike.BC.BikeInfoMutable;
using TINK.Model.Device;
using BikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable;
namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
{
@ -29,9 +27,6 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
{
}
/// <summary> Gets the bike state. </summary>
public override InUseStateEnum State => InUseStateEnum.Reserved;
/// <summary> Executes user request to cancel reservation. </summary>
public async Task<IRequestHandler> HandleRequest()
{

View file

@ -4,7 +4,7 @@ using TINK.Model.Device;
using TINK.Model.User;
using TINK.View;
using TINK.ViewModel.Bikes.Bike.BC.RequestHandler;
using BikeInfoMutable = TINK.Model.Bike.BC.BikeInfoMutable;
using BikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable;
namespace TINK.ViewModel.Bikes.Bike.BC
{