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
{
/// Provides in use state information.
/// View model to be used for progress report and unlocking/ locking view.
public static BikeViewModelBase Create(
Func isConnectedDelegate,
Func connectorFactory,
IGeolocation geolocation,
ILocksService lockService,
Action bikeRemoveDelegate,
Func 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);
}
}
}