2023-04-05 15:02:10 +02:00
|
|
|
using System;
|
2021-05-13 20:03:07 +02:00
|
|
|
using TINK.Model.Connector;
|
2022-08-30 15:42:25 +02:00
|
|
|
using TINK.Model.Device;
|
|
|
|
using TINK.Model.User;
|
2021-05-13 20:03:07 +02:00
|
|
|
using TINK.Services.BluetoothLock;
|
2022-04-10 17:38:34 +02:00
|
|
|
using TINK.Services.Geolocation;
|
2021-05-13 20:03:07 +02:00
|
|
|
using TINK.View;
|
|
|
|
|
|
|
|
namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
public abstract class Base : BC.RequestHandler.Base<Model.Bikes.BikeInfoNS.BluetoothLock.IBikeInfoMutable>
|
|
|
|
{
|
|
|
|
/// <summary>
|
2023-06-06 12:00:24 +02:00
|
|
|
/// Constructs the request handler base.
|
2022-09-06 16:08:19 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="selectedBike">Bike which is reserved or for which reservation is canceled.</param>
|
|
|
|
/// <param name="smartDevice">Provides info about the smart device (phone, tablet, ...)</param>
|
|
|
|
/// <param name="bikesViewModel">View model to be used for progress report and unlocking/ locking view.</param>
|
|
|
|
public Base(
|
|
|
|
Model.Bikes.BikeInfoNS.BluetoothLock.IBikeInfoMutable selectedBike,
|
|
|
|
string buttonText,
|
|
|
|
bool isCopriButtonVisible,
|
|
|
|
Func<bool> isConnectedDelegate,
|
|
|
|
Func<bool, IConnector> connectorFactory,
|
2023-04-05 15:02:10 +02:00
|
|
|
IGeolocationService geolocation,
|
2022-09-06 16:08:19 +02:00
|
|
|
ILocksService lockService,
|
|
|
|
Func<IPollingUpdateTaskManager> viewUpdateManager,
|
|
|
|
ISmartDevice smartDevice,
|
|
|
|
IViewService viewService,
|
|
|
|
IBikesViewModel bikesViewModel,
|
|
|
|
IUser activeUser) : base(selectedBike, buttonText, isCopriButtonVisible, isConnectedDelegate, connectorFactory, viewUpdateManager, smartDevice, viewService, bikesViewModel, activeUser)
|
|
|
|
{
|
2023-04-05 15:02:10 +02:00
|
|
|
GeolocationService = geolocation
|
2022-09-06 16:08:19 +02:00
|
|
|
?? throw new ArgumentException($"Can not construct {GetType().Name}-object. Parameter {nameof(geolocation)} must not be null.");
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
LockService = lockService
|
|
|
|
?? throw new ArgumentException($"Can not construct {GetType().Name}-object. Parameter {nameof(lockService)} must not be null.");
|
|
|
|
}
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2023-08-31 12:20:06 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Service to query geolocation information.
|
|
|
|
/// </summary>
|
2023-04-05 15:02:10 +02:00
|
|
|
protected IGeolocationService GeolocationService { get; }
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2023-08-31 12:20:06 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Service to control locks.
|
|
|
|
/// </summary>
|
2022-09-06 16:08:19 +02:00
|
|
|
protected ILocksService LockService { get; }
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
public string LockitButtonText { get; protected set; }
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
public bool IsLockitButtonVisible { get; protected set; }
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
public string ErrorText => string.Empty;
|
|
|
|
}
|
2021-05-13 20:03:07 +02:00
|
|
|
}
|