This commit is contained in:
Oliver Hauff 2022-01-22 18:30:23 +01:00
parent 578fcee611
commit 6ed1579494
34 changed files with 357 additions and 89 deletions

View file

@ -36,9 +36,6 @@ namespace TINK.ViewModel.BikesAtStation
/// </summary>
private readonly IStation m_oStation;
/// <summary> Holds a reference to the external trigger service. </summary>
private Action<string> OpenUrlInExternalBrowser { get; }
/// <summary>
/// Constructs bike collection view model.
/// </summary>
@ -70,11 +67,8 @@ namespace TINK.ViewModel.BikesAtStation
Action<string> openUrlInExternalBrowser,
Action<SendOrPostCallback, object> postAction,
ISmartDevice smartDevice,
IViewService viewService) : base(user, permissions, bluetoothLE, runtimPlatform, isConnectedDelegate, connectorFactory, geolocation, lockService, polling, postAction, smartDevice, viewService, () => new BikeAtStationInUseStateInfoProvider())
IViewService viewService) : base(user, permissions, bluetoothLE, runtimPlatform, isConnectedDelegate, connectorFactory, geolocation, lockService, polling, postAction, smartDevice, viewService, openUrlInExternalBrowser, () => new BikeAtStationInUseStateInfoProvider())
{
OpenUrlInExternalBrowser = openUrlInExternalBrowser
?? throw new ArgumentException("Can not instantiate login page view model- object. No user external browse service available.");
m_oStation = selectedStation;
Title = string.Format(m_oStation?.StationName != null
@ -387,20 +381,5 @@ namespace TINK.ViewModel.BikesAtStation
base.OnPropertyChanged(new PropertyChangedEventArgs(nameof(NoBikesAtStationText)));
}
}
/// <summary> Opens login page.</summary>
/// <param name="url">Url to open.</param>
private void RegisterRequest(string url)
{
try
{
OpenUrlInExternalBrowser(url);
}
catch (Exception p_oException)
{
Log.Error("Ein unerwarteter Fehler ist auf der Login Seite beim Öffnen eines Browsers, Seite {url}, aufgetreten. {@Exception}", url, p_oException);
return;
}
}
}
}