mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-19 11:37:28 +02:00
Initial version.
This commit is contained in:
parent
193aaa1a56
commit
b72c67a53e
228 changed files with 25924 additions and 0 deletions
52
TINKLib/ViewModel/Bikes/Bike/BikeViewModelFactory.cs
Normal file
52
TINKLib/ViewModel/Bikes/Bike/BikeViewModelFactory.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Model.User;
|
||||
using TINK.View;
|
||||
|
||||
namespace TINK.ViewModel.Bikes.Bike
|
||||
{
|
||||
public static class BikeViewModelFactory
|
||||
{
|
||||
/// <param name="stateInfoProvider">Provides in use state information.</param>
|
||||
/// <param name="bikesViewModel">View model to be used for progress report and unlocking/ locking view.</param>
|
||||
public static BikeViewModelBase Create(
|
||||
Func<bool> isConnectedDelegate,
|
||||
Func<bool, IConnector> connectorFactory,
|
||||
IGeolocation geolocation,
|
||||
ILocksService lockService,
|
||||
Action<int> bikeRemoveDelegate,
|
||||
Func<IPollingUpdateTaskManager> viewUpdateManager,
|
||||
IViewService viewService,
|
||||
Model.Bike.BC.BikeInfoMutable bikeInfo,
|
||||
IUser activeUser,
|
||||
IInUseStateInfoProvider stateInfoProvider,
|
||||
IBikesViewModel bikesViewModel)
|
||||
{
|
||||
return bikeInfo as Model.Bikes.Bike.BluetoothLock.IBikeInfoMutable != null
|
||||
? new BluetoothLock.BikeViewModel(
|
||||
isConnectedDelegate,
|
||||
connectorFactory,
|
||||
geolocation,
|
||||
lockService,
|
||||
bikeRemoveDelegate,
|
||||
viewUpdateManager,
|
||||
viewService,
|
||||
bikeInfo as Model.Bike.BluetoothLock.BikeInfoMutable,
|
||||
activeUser,
|
||||
stateInfoProvider,
|
||||
bikesViewModel) as BikeViewModelBase
|
||||
: new BC.BikeViewModel(
|
||||
isConnectedDelegate,
|
||||
connectorFactory,
|
||||
bikeRemoveDelegate,
|
||||
viewUpdateManager,
|
||||
viewService,
|
||||
bikeInfo,
|
||||
activeUser,
|
||||
stateInfoProvider,
|
||||
bikesViewModel);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue