using System; using TINK.Model.Connector; using TINK.Model.Device; using TINK.Model.User; using TINK.Services.BluetoothLock; using TINK.Services.Geolocation; using TINK.View; namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler { public abstract class Base : BC.RequestHandler.Base { /// /// Constructs the request handler base. /// /// Bike which is reserved or for which reservation is canceled. /// Provides info about the smart device (phone, tablet, ...) /// View model to be used for progress report and unlocking/ locking view. public Base( Model.Bikes.BikeInfoNS.BluetoothLock.IBikeInfoMutable selectedBike, string buttonText, bool isCopriButtonVisible, Func isConnectedDelegate, Func connectorFactory, IGeolocationService geolocation, ILocksService lockService, Func viewUpdateManager, ISmartDevice smartDevice, IViewService viewService, IBikesViewModel bikesViewModel, IUser activeUser) : base(selectedBike, buttonText, isCopriButtonVisible, isConnectedDelegate, connectorFactory, viewUpdateManager, smartDevice, viewService, bikesViewModel, activeUser) { GeolocationService = geolocation ?? throw new ArgumentException($"Can not construct {GetType().Name}-object. Parameter {nameof(geolocation)} must not be null."); LockService = lockService ?? throw new ArgumentException($"Can not construct {GetType().Name}-object. Parameter {nameof(lockService)} must not be null."); } protected IGeolocationService GeolocationService { get; } protected ILocksService LockService { get; } public string LockitButtonText { get; protected set; } public bool IsLockitButtonVisible { get; protected set; } public string ErrorText => string.Empty; } }