diff --git a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml index ba09c9d..c988df6 100644 --- a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml +++ b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/LastenradBayern/TINK.iOS/Info.plist b/LastenradBayern/TINK.iOS/Info.plist index e1d0af6..fce3d71 100644 --- a/LastenradBayern/TINK.iOS/Info.plist +++ b/LastenradBayern/TINK.iOS/Info.plist @@ -55,8 +55,8 @@ CFBundleDisplayName LastenradBayern CFBundleVersion - 346 + 347 CFBundleShortVersionString - 3.0.346 + 3.0.347 diff --git a/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj b/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj index 3d6a35d..2d94ce9 100644 --- a/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj +++ b/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj @@ -40,8 +40,8 @@ SdkOnly x86_64 false - VS: com.TeilRad.LastenradBayern Development - Apple Development: Oliver Hauff (8SZ7J9P24J) + LastenradBayern to App Store 3 + Apple Distribution: TeilRad GmbH (LXJD6URCHR) true @@ -69,9 +69,9 @@ 4 ARM64 false - Apple Development: Oliver Hauff (8SZ7J9P24J) + Apple Distribution: TeilRad GmbH (LXJD6URCHR) Entitlements.plist - VS: com.TeilRad.LastenradBayern Development + LastenradBayern to App Store 3 diff --git a/Meinkonrad/TINK.Android/Properties/AndroidManifest.xml b/Meinkonrad/TINK.Android/Properties/AndroidManifest.xml index 5f28e71..b989551 100644 --- a/Meinkonrad/TINK.Android/Properties/AndroidManifest.xml +++ b/Meinkonrad/TINK.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/Meinkonrad/TINK.iOS/Info.plist b/Meinkonrad/TINK.iOS/Info.plist index 0b50689..de336e7 100644 --- a/Meinkonrad/TINK.iOS/Info.plist +++ b/Meinkonrad/TINK.iOS/Info.plist @@ -55,8 +55,8 @@ CFBundleDisplayName Mein konrad CFBundleVersion - 346 + 347 CFBundleShortVersionString - 3.0.346 + 3.0.347 diff --git a/TINK/TINK.Android/Properties/AndroidManifest.xml b/TINK/TINK.Android/Properties/AndroidManifest.xml index f297257..18f969d 100644 --- a/TINK/TINK.Android/Properties/AndroidManifest.xml +++ b/TINK/TINK.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/TINK/TINK.iOS/Info.plist b/TINK/TINK.iOS/Info.plist index 700dac6..a5f2e0d 100644 --- a/TINK/TINK.iOS/Info.plist +++ b/TINK/TINK.iOS/Info.plist @@ -55,8 +55,8 @@ CFBundleDisplayName sharee.bike CFBundleVersion - 346 + 347 CFBundleShortVersionString - 3.0.346 + 3.0.347 diff --git a/TINK/TINK.iOS/TINK.iOS.csproj b/TINK/TINK.iOS/TINK.iOS.csproj index 6e29856..35b4955 100644 --- a/TINK/TINK.iOS/TINK.iOS.csproj +++ b/TINK/TINK.iOS/TINK.iOS.csproj @@ -40,8 +40,8 @@ SdkOnly x86_64 false - VS: com.TeilRad.sharee.bike Development - Apple Development: Oliver Hauff (8SZ7J9P24J) + sharee.bike to App Store 3 + Apple Distribution: TeilRad GmbH (LXJD6URCHR) 15.5 @@ -70,9 +70,9 @@ 4 ARM64 false - Apple Development: Oliver Hauff (8SZ7J9P24J) + Apple Distribution: TeilRad GmbH (LXJD6URCHR) Entitlements.plist - VS: com.TeilRad.sharee.bike Development + sharee.bike to App Store 3 diff --git a/TINKLib/Model/WhatsNew.cs b/TINKLib/Model/WhatsNew.cs index a578f11..1bcfce9 100644 --- a/TINKLib/Model/WhatsNew.cs +++ b/TINKLib/Model/WhatsNew.cs @@ -616,13 +616,13 @@ namespace TINK.Model new List { AppFlavor.LastenradBayern } }, { - new Version(3, 0, 346), - AppResources.ChangeLog_3_0_346_LB_MK, + new Version(3, 0, 347), + AppResources.ChangeLog_3_0_347_LB_MK, new List { AppFlavor.LastenradBayern, AppFlavor.MeinKonrad } }, { - new Version(3, 0, 346), - AppResources.ChangeLog_3_0_346_SB, + new Version(3, 0, 347), + AppResources.ChangeLog_3_0_347_SB, new List { AppFlavor.ShareeBike } }, }; diff --git a/TINKLib/MultilingualResources/AppResources.Designer.cs b/TINKLib/MultilingualResources/AppResources.Designer.cs index 9bc0c87..e08ce9c 100644 --- a/TINKLib/MultilingualResources/AppResources.Designer.cs +++ b/TINKLib/MultilingualResources/AppResources.Designer.cs @@ -669,11 +669,12 @@ namespace TINK.MultilingualResources { } /// - /// Looks up a localized string similar to <i>Select Bike</i> page revised.. + /// Looks up a localized string similar to <i>Select Bike</i> page revised.<br/> + ///Minor improvements.<br/>. /// - public static string ChangeLog_3_0_346_LB_MK { + public static string ChangeLog_3_0_347_LB_MK { get { - return ResourceManager.GetString("ChangeLog_3_0_346_LB_MK", resourceCulture); + return ResourceManager.GetString("ChangeLog_3_0_347_LB_MK", resourceCulture); } } @@ -684,11 +685,12 @@ namespace TINK.MultilingualResources { ///<li/><i>Bike Locations</i> or ///<li/><i>Select Bike</i> ///</ul> - ///page.. + ///page.<br/> + ///Minor improvements.<br/>. /// - public static string ChangeLog_3_0_346_SB { + public static string ChangeLog_3_0_347_SB { get { - return ResourceManager.GetString("ChangeLog_3_0_346_SB", resourceCulture); + return ResourceManager.GetString("ChangeLog_3_0_347_SB", resourceCulture); } } @@ -1500,6 +1502,15 @@ namespace TINK.MultilingualResources { } } + /// + /// Looks up a localized string similar to Not connected to network.. + /// + public static string ErrorNotConnectedToNetwork { + get { + return ResourceManager.GetString("ErrorNotConnectedToNetwork", resourceCulture); + } + } + /// /// Looks up a localized string similar to Lock is blocked. Please ensure that no obstacle prevents lock from opening and try again.. /// @@ -1721,7 +1732,7 @@ namespace TINK.MultilingualResources { } /// - /// Looks up a localized string similar to Is WIFI available/ mobile networt available and mobile data activated / ... ?. + /// Looks up a localized string similar to Is WIFI available/ mobile network available and mobile data activated / ... ?. /// public static string ExceptionTextWebConnectFailureException { get { diff --git a/TINKLib/MultilingualResources/AppResources.de.resx b/TINKLib/MultilingualResources/AppResources.de.resx index c9d06e7..832479b 100644 --- a/TINKLib/MultilingualResources/AppResources.de.resx +++ b/TINKLib/MultilingualResources/AppResources.de.resx @@ -1066,16 +1066,23 @@ Sie können nun auf einen Blick sehen, welche App-Version Sie installiert haben: Startseite - - <i>Rad auswählen</i> Seite überarbeitet. + + <i>Rad auswählen</i> Seite überarbeitet.<br/> +Kleinere Verbesserungen.<br/> + + - + + Keine Verbindung zum Netzwerk. + + <i>Rad auswählen</i>- Seite überarbeitet.<br/> Einstellung hinzugefügt mit der festgelegt werden kann, ob die App mit der Seite <ul> <li/><i>Radstandorte</i> oder <li/><i>Rad auswählen</i> </ul> -gestartet wird. +gestartet wird.<br/> +Kleinere Verbesserungen.<br/> \ No newline at end of file diff --git a/TINKLib/MultilingualResources/AppResources.resx b/TINKLib/MultilingualResources/AppResources.resx index b409329..ddefafb 100644 --- a/TINKLib/MultilingualResources/AppResources.resx +++ b/TINKLib/MultilingualResources/AppResources.resx @@ -941,7 +941,7 @@ Activity indicator added account management pages and logging extended. Starting bike return... - Is WIFI available/ mobile networt available and mobile data activated / ... ? + Is WIFI available/ mobile network available and mobile data activated / ... ? Flyout menu header improved. @@ -1158,16 +1158,21 @@ You can now see at a glance which app version you have installed: in the menu at Startup page - - <i>Select Bike</i> page revised. + + <i>Select Bike</i> page revised.<br/> +Minor improvements.<br/> - + <i>Select Bike</i>- page revised.<br/> Setting added to select whether the app starts up showing either <ul> <li/><i>Bike Locations</i> or <li/><i>Select Bike</i> </ul> -page. +page.<br/> +Minor improvements.<br/> + + + Not connected to network. diff --git a/TINKLib/MultilingualResources/TINKLib.de.xlf b/TINKLib/MultilingualResources/TINKLib.de.xlf index 34d6914..52748ae 100644 --- a/TINKLib/MultilingualResources/TINKLib.de.xlf +++ b/TINKLib/MultilingualResources/TINKLib.de.xlf @@ -1145,7 +1145,7 @@ Activity Indicator zu Konto-Verwaltungsseiten hinzugefügt und Logging erweitert Starte Rückgabe... - Is WIFI available/ mobile networt available and mobile data activated / ... ? + Is WIFI available/ mobile network available and mobile data activated / ... ? Ist WLAN verfügbar/ Mobilfunknetz vefügbar und mobile Daten aktiviert / ... ? @@ -1450,25 +1450,35 @@ Sie können nun auf einen Blick sehen, welche App-Version Sie installiert haben: Startup page Startseite - - <i>Select Bike</i> page revised. - <i>Rad auswählen</i> Seite überarbeitet. + + <i>Select Bike</i> page revised.<br/> +Minor improvements.<br/> + <i>Rad auswählen</i> Seite überarbeitet.<br/> +Kleinere Verbesserungen.<br/> + + - + + Not connected to network. + Keine Verbindung zum Netzwerk. + + <i>Select Bike</i>- page revised.<br/> Setting added to select whether the app starts up showing either <ul> <li/><i>Bike Locations</i> or <li/><i>Select Bike</i> </ul> -page. - <i>Rad auswählen</i>- Seite überarbeitet.<br/> +page.<br/> +Minor improvements.<br/> + <i>Rad auswählen</i>- Seite überarbeitet.<br/> Einstellung hinzugefügt mit der festgelegt werden kann, ob die App mit der Seite -<ul> -<li/><i>Radstandorte</i> oder -<li/><i>Rad auswählen</i> -</ul> -gestartet wird. +<ul> +<li/><i>Radstandorte</i> oder +<li/><i>Rad auswählen</i> +</ul> +gestartet wird.<br/> +Kleinere Verbesserungen.<br/> diff --git a/TINKLib/Services/CopriApi/CopriProviderHttps.cs b/TINKLib/Services/CopriApi/CopriProviderHttps.cs index f8e06ae..8ed9724 100644 --- a/TINKLib/Services/CopriApi/CopriProviderHttps.cs +++ b/TINKLib/Services/CopriApi/CopriProviderHttps.cs @@ -212,14 +212,10 @@ namespace TINK.Model.Services.CopriApi } public async Task DoReserveAsync(string bikeId, Uri operatorUri) - { - return await HttpsServer.DoReserveAsync(bikeId, operatorUri); - } + => await HttpsServer.DoReserveAsync(bikeId, operatorUri); public async Task DoCancelReservationAsync(string bikeId, Uri operatorUri) - { - return await HttpsServer.DoCancelReservationAsync(bikeId, operatorUri); - } + => await HttpsServer.DoCancelReservationAsync(bikeId, operatorUri); public async Task CalculateAuthKeysAsync(string bikeId, Uri operatorUri) { diff --git a/TINKLib/Services/CopriApi/CopriProviderMonkeyStore.cs b/TINKLib/Services/CopriApi/CopriProviderMonkeyStore.cs index cdfa7e7..45dd7ca 100644 --- a/TINKLib/Services/CopriApi/CopriProviderMonkeyStore.cs +++ b/TINKLib/Services/CopriApi/CopriProviderMonkeyStore.cs @@ -6,6 +6,7 @@ using TINK.Model.Device; using TINK.Repository; using TINK.Repository.Request; using TINK.Repository.Response; +using TINK.Services.CopriApi.Exception; namespace TINK.Model.Services.CopriApi { @@ -35,13 +36,13 @@ namespace TINK.Model.Services.CopriApi public string MerchantId => monkeyStore.MerchantId; public Task DoReserveAsync(string bikeId, Uri operatorUri) - => throw new NotSupportedException($"{nameof(DoReserveAsync)} is not cachable."); + => throw new RequestNotCachableException(nameof(DoReserveAsync)); public Task DoCancelReservationAsync(string bikeId, Uri operatorUri) - => throw new NotSupportedException($"{nameof(DoCancelReservationAsync)} is not cachable."); + => throw new RequestNotCachableException(nameof(DoCancelReservationAsync)); public Task CalculateAuthKeysAsync(string bikeId, Uri operatorUri) - => throw new NotSupportedException($"{nameof(CalculateAuthKeysAsync)} is not cachable."); + => throw new RequestNotCachableException(nameof(CalculateAuthKeysAsync)); public async Task StartReturningBike( string bikeId, @@ -65,9 +66,7 @@ namespace TINK.Model.Services.CopriApi versionInfo); public async Task DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri) - { - return await monkeyStore.DoBookAsync(bikeId, guid, batteryPercentage, operatorUri); - } + => await monkeyStore.DoBookAsync(bikeId, guid, batteryPercentage, operatorUri); public async Task BookAvailableAndStartOpeningAsync( string bikeId, @@ -93,37 +92,26 @@ namespace TINK.Model.Services.CopriApi => await monkeyStore.ReturnAndStartClosingAsync(bikeId, smartDevice, operatorUri); public Task DoSubmitFeedback(string bikeId, int? currentChargeBars, string messge, bool bIsBikeBroke, Uri operatorUri) - => throw new NotImplementedException(); + => throw new RequestNotCachableException(nameof(DoSubmitFeedback)); /// Submits mini survey to copri server. /// Collection of answers. public Task DoSubmitMiniSurvey(IDictionary answers) - => throw new NotSupportedException(); - + => throw new RequestNotCachableException(nameof(DoSubmitMiniSurvey)); public async Task DoAuthorizationAsync(string p_strMailAddress, string p_strPassword, string p_strDeviceId) - { - return await monkeyStore.DoAuthorizationAsync(p_strMailAddress, p_strPassword, p_strDeviceId); - } + => await monkeyStore.DoAuthorizationAsync(p_strMailAddress, p_strPassword, p_strDeviceId); public async Task DoAuthoutAsync() - { - return await monkeyStore.DoAuthoutAsync(); - } + => await monkeyStore.DoAuthoutAsync(); public async Task GetBikesAvailableAsync() - { - return await monkeyStore.GetBikesAvailableAsync(); - } + => await monkeyStore.GetBikesAvailableAsync(); public async Task GetBikesOccupiedAsync() - { - return await monkeyStore.GetBikesOccupiedAsync(); - } + => await monkeyStore.GetBikesOccupiedAsync(); public async Task GetStationsAsync() - { - return await monkeyStore.GetStationsAsync(); - } + => await monkeyStore.GetStationsAsync(); } } diff --git a/TINKLib/Services/CopriApi/Exception/RequestNotCachableException.cs b/TINKLib/Services/CopriApi/Exception/RequestNotCachableException.cs new file mode 100644 index 0000000..185ea1c --- /dev/null +++ b/TINKLib/Services/CopriApi/Exception/RequestNotCachableException.cs @@ -0,0 +1,12 @@ + +using TINK.MultilingualResources; + +namespace TINK.Services.CopriApi.Exception +{ + public class RequestNotCachableException : System.Exception + { + public RequestNotCachableException(string nameOfAction) : base(AppResources.ErrorNotConnectedToNetwork, new System.Exception($"{nameOfAction} is not cacheable.")) + { + } + } +} diff --git a/TINKLib/ViewModel/Bikes/Bike/BC/RequestHandler/Disposable.cs b/TINKLib/ViewModel/Bikes/Bike/BC/RequestHandler/Disposable.cs index 06efe2a..1767b3c 100644 --- a/TINKLib/ViewModel/Bikes/Bike/BC/RequestHandler/Disposable.cs +++ b/TINKLib/ViewModel/Bikes/Bike/BC/RequestHandler/Disposable.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Serilog; using TINK.Model.Connector; @@ -7,6 +7,7 @@ using TINK.Model.State; using TINK.Model.User; using TINK.MultilingualResources; using TINK.Repository.Exception; +using TINK.Services.CopriApi.Exception; using TINK.View; using BikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable; @@ -59,20 +60,21 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler { await ConnectorFactory(IsConnected).Command.DoReserve(SelectedBike); } - catch (Exception l_oException) + catch (Exception exception) { - if (l_oException is BookingDeclinedException) + if (exception is BookingDeclinedException) { // Too many bikes booked. - Log.ForContext().Information("Request declined because maximum count of bikes {l_oException.MaxBikesCount} already requested/ booked.", (l_oException as BookingDeclinedException).MaxBikesCount); + Log.ForContext().Information("Request declined because maximum count of bikes {l_oException.MaxBikesCount} already requested/ booked.", (exception as BookingDeclinedException).MaxBikesCount); BikesViewModel.ActionText = string.Empty; await ViewService.DisplayAlert( AppResources.MessageTitleHint, - string.Format(AppResources.MessageReservationBikeErrorTooManyReservationsRentals, SelectedBike.Id, (l_oException as BookingDeclinedException).MaxBikesCount), + string.Format(AppResources.MessageReservationBikeErrorTooManyReservationsRentals, SelectedBike.Id, (exception as BookingDeclinedException).MaxBikesCount), AppResources.MessageAnswerOk); } - else if (l_oException is WebConnectFailureException) + else if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected availalbe bike {l_oId} but reserving failed (Copri server not reachable).", SelectedBike.Id); @@ -80,15 +82,15 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler BikesViewModel.ActionText = string.Empty; await ViewService.DisplayAlert( AppResources.MessageReservingBikeErrorConnectionTitle, - string.Format("{0}\r\n{1}", l_oException.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), + string.Format("{0}\r\n{1}", exception.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), AppResources.MessageAnswerOk); } else { - Log.ForContext().Error("User selected availalbe bike {l_oId} but reserving failed. {@l_oException}", SelectedBike.Id, l_oException); + Log.ForContext().Error("User selected availalbe bike {l_oId} but reserving failed. {@l_oException}", SelectedBike.Id, exception); BikesViewModel.ActionText = string.Empty; - await ViewService.DisplayAlert(AppResources.MessageReservingBikeErrorGeneralTitle, l_oException.Message, AppResources.MessageAnswerOk); + await ViewService.DisplayAlert(AppResources.MessageReservingBikeErrorGeneralTitle, exception.Message, AppResources.MessageAnswerOk); } BikesViewModel.ActionText = string.Empty; // Todo: Remove this statement because in catch block ActionText is already set to empty above. diff --git a/TINKLib/ViewModel/Bikes/Bike/BC/RequestHandler/Reserved.cs b/TINKLib/ViewModel/Bikes/Bike/BC/RequestHandler/Reserved.cs index 7f58278..d8df384 100644 --- a/TINKLib/ViewModel/Bikes/Bike/BC/RequestHandler/Reserved.cs +++ b/TINKLib/ViewModel/Bikes/Bike/BC/RequestHandler/Reserved.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Serilog; using TINK.Model.Connector; @@ -6,6 +6,7 @@ using TINK.Model.Device; using TINK.Model.User; using TINK.MultilingualResources; using TINK.Repository.Exception; +using TINK.Services.CopriApi.Exception; using TINK.View; using BikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable; @@ -63,34 +64,35 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler // If canceling bike succedes remove bike because it is not ready to be booked again IsRemoveBikeRequired = true; } - catch (Exception l_oException) + catch (Exception exception) { - if (l_oException is InvalidAuthorizationResponseException) + if (exception is InvalidAuthorizationResponseException) { // Copri response is invalid. Log.ForContext().Error("User selected reserved bike {l_oId} but canceling reservation failed (Invalid auth. response).", SelectedBike.Id); BikesViewModel.ActionText = String.Empty; - await ViewService.DisplayAlert("Fehler beim Stornieren der Buchung!", l_oException.Message, "OK"); + await ViewService.DisplayAlert("Fehler beim Stornieren der Buchung!", exception.Message, "OK"); BikesViewModel.IsIdle = true; return this; } - else if (l_oException is WebConnectFailureException) + else if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected reserved bike {l_oId} but cancel reservation failed (Copri server not reachable).", SelectedBike.Id); BikesViewModel.ActionText = String.Empty; await ViewService.DisplayAlert( "Verbingungsfehler beim Stornieren der Buchung!", - string.Format("{0}\r\n{1}", l_oException.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), + string.Format("{0}\r\n{1}", exception.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), "OK"); BikesViewModel.IsIdle = true; return this; } else { - Log.ForContext().Error("User selected reserved bike {l_oId} but cancel reservation failed. {@l_oException}.", SelectedBike.Id, l_oException); + Log.ForContext().Error("User selected reserved bike {l_oId} but cancel reservation failed. {@l_oException}.", SelectedBike.Id, exception); BikesViewModel.ActionText = String.Empty; - await ViewService.DisplayAlert("Fehler beim Stornieren der Buchung!", l_oException.Message, "OK"); + await ViewService.DisplayAlert("Fehler beim Stornieren der Buchung!", exception.Message, "OK"); BikesViewModel.IsIdle = true; return this; } diff --git a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/BookedClosed.cs b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/BookedClosed.cs index c46b9ba..a9d060d 100644 --- a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/BookedClosed.cs +++ b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/BookedClosed.cs @@ -57,7 +57,6 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler /// Open bike and update COPRI lock state. public async Task HandleRequestOption2() => await OpenLock(); - /// Return bike. public async Task ReturnBike() { diff --git a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/BookedDisconnected.cs b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/BookedDisconnected.cs index bb09baa..fafd631 100644 --- a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/BookedDisconnected.cs +++ b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/BookedDisconnected.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Serilog; using TINK.Model.Bikes.BikeInfoNS.BluetoothLock; @@ -10,6 +10,7 @@ using TINK.Repository.Exception; using TINK.Services.BluetoothLock; using TINK.Services.BluetoothLock.Exception; using TINK.Services.BluetoothLock.Tdo; +using TINK.Services.CopriApi.Exception; using TINK.Services.Geolocation; using TINK.View; @@ -85,7 +86,8 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler { BikesViewModel.ActionText = string.Empty; - if (exception is WebConnectFailureException) + if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected booked bike {l_oId} to connect to lock. (Copri server not reachable).", SelectedBike.Id); diff --git a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/DisposableDisconnected.cs b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/DisposableDisconnected.cs index a5b9f38..b3a3200 100644 --- a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/DisposableDisconnected.cs +++ b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/DisposableDisconnected.cs @@ -11,6 +11,7 @@ using TINK.Repository.Exception; using TINK.Services.BluetoothLock; using TINK.Services.BluetoothLock.Exception; using TINK.Services.BluetoothLock.Tdo; +using TINK.Services.CopriApi.Exception; using TINK.Services.Geolocation; using TINK.View; @@ -101,7 +102,8 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler string.Format(AppResources.MessageReservationBikeErrorTooManyReservationsRentals, SelectedBike.Id, (exception as BookingDeclinedException).MaxBikesCount), AppResources.MessageAnswerOk); } - else if (exception is WebConnectFailureException) + else if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected availalbe bike {bike} but reserving failed (Copri server not reachable).", SelectedBike); diff --git a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedClosed.cs b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedClosed.cs index ab41883..c95ac62 100644 --- a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedClosed.cs +++ b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedClosed.cs @@ -9,6 +9,7 @@ using TINK.MultilingualResources; using TINK.Repository.Exception; using TINK.Services.BluetoothLock; using TINK.Services.BluetoothLock.Exception; +using TINK.Services.CopriApi.Exception; using TINK.Services.Geolocation; using TINK.View; using IBikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BluetoothLock.IBikeInfoMutable; @@ -93,35 +94,36 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler // If canceling bike succedes remove bike because it is not ready to be booked again IsRemoveBikeRequired = true; } - catch (Exception l_oException) + catch (Exception exception) { BikesViewModel.ActionText = string.Empty; - if (l_oException is InvalidAuthorizationResponseException) + if (exception is InvalidAuthorizationResponseException) { // Copri response is invalid. Log.ForContext().Error("User selected reserved bike {l_oId} but canceling reservation failed (Invalid auth. response).", SelectedBike.Id); await ViewService.DisplayAlert( AppResources.MessageCancelReservationBikeErrorGeneralTitle, - l_oException.Message, + exception.Message, AppResources.MessageAnswerOk); } - else if (l_oException is WebConnectFailureException) + else if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected reserved bike {l_oId} but cancel reservation failed (Copri server not reachable).", SelectedBike.Id); await ViewService.DisplayAlert( AppResources.MessageCancelReservationBikeErrorConnectionTitle, - string.Format("{0}\r\n{1}", l_oException.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), + string.Format("{0}\r\n{1}", exception.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), AppResources.MessageAnswerOk); } else { - Log.ForContext().Error("User selected reserved bike {l_oId} but cancel reservation failed. {@l_oException}.", SelectedBike.Id, l_oException); + Log.ForContext().Error("User selected reserved bike {l_oId} but cancel reservation failed. {@l_oException}.", SelectedBike.Id, exception); await ViewService.DisplayAlert( AppResources.MessageCancelReservationBikeErrorGeneralTitle, - l_oException.Message, + exception.Message, AppResources.MessageAnswerOk); } diff --git a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedDisconnected.cs b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedDisconnected.cs index b1764fd..a0803de 100644 --- a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedDisconnected.cs +++ b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedDisconnected.cs @@ -10,6 +10,7 @@ using TINK.Repository.Exception; using TINK.Services.BluetoothLock; using TINK.Services.BluetoothLock.Exception; using TINK.Services.BluetoothLock.Tdo; +using TINK.Services.CopriApi.Exception; using TINK.Services.Geolocation; using TINK.View; @@ -88,33 +89,34 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler // If canceling bike succedes remove bike because it is not ready to be booked again IsRemoveBikeRequired = true; } - catch (Exception l_oException) + catch (Exception exception) { BikesViewModel.ActionText = string.Empty; - if (l_oException is InvalidAuthorizationResponseException) + if (exception is InvalidAuthorizationResponseException) { // Copri response is invalid. Log.ForContext().Error("User selected reserved bike {l_oId} but canceling reservation failed (Invalid auth. response).", SelectedBike.Id); await ViewService.DisplayAlert( AppResources.MessageCancelReservationBikeErrorGeneralTitle, - l_oException.Message, + exception.Message, AppResources.MessageAnswerOk); } - else if (l_oException is WebConnectFailureException) + else if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected reserved bike {l_oId} but cancel reservation failed (Copri server not reachable).", SelectedBike.Id); await ViewService.DisplayAlert( AppResources.MessageCancelReservationBikeErrorConnectionTitle, - string.Format("{0}\r\n{1}", l_oException.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), + string.Format("{0}\r\n{1}", exception.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), AppResources.MessageAnswerOk); } else { - Log.ForContext().Error("User selected reserved bike {l_oId} but cancel reservation failed. {@l_oException}.", SelectedBike.Id, l_oException); + Log.ForContext().Error("User selected reserved bike {l_oId} but cancel reservation failed. {@l_oException}.", SelectedBike.Id, exception); await ViewService.DisplayAlert( AppResources.MessageCancelReservationBikeErrorGeneralTitle, - l_oException.Message, + exception.Message, "OK"); } @@ -156,7 +158,8 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler { BikesViewModel.ActionText = string.Empty; - if (exception is WebConnectFailureException) + if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected requested bike {l_oId} to connect to lock. (Copri server not reachable).", SelectedBike.Id); diff --git a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedOpen.cs b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedOpen.cs index 15aaf50..8554a73 100644 --- a/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedOpen.cs +++ b/TINKLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/ReservedOpen.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Serilog; using TINK.Model.Bikes.BikeInfoNS.BluetoothLock; @@ -9,6 +9,7 @@ using TINK.MultilingualResources; using TINK.Repository.Exception; using TINK.Services.BluetoothLock; using TINK.Services.BluetoothLock.Exception; +using TINK.Services.CopriApi.Exception; using TINK.Services.Geolocation; using TINK.View; @@ -231,34 +232,35 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler // If canceling bike succedes remove bike because it is not ready to be booked again IsRemoveBikeRequired = true; } - catch (Exception l_oException) + catch (Exception exception) { BikesViewModel.ActionText = String.Empty; - if (l_oException is InvalidAuthorizationResponseException) + if (exception is InvalidAuthorizationResponseException) { // Copri response is invalid. Log.ForContext().Error("User selected reserved bike {l_oId} but canceling reservation failed (Invalid auth. response).", SelectedBike.Id); await ViewService.DisplayAlert( AppResources.MessageCancelReservationBikeErrorGeneralTitle, - l_oException.Message, + exception.Message, AppResources.MessageAnswerOk); } - else if (l_oException is WebConnectFailureException) + else if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected reserved bike {l_oId} but cancel reservation failed (Copri server not reachable).", SelectedBike.Id); await ViewService.DisplayAlert( AppResources.MessageCancelReservationBikeErrorConnectionTitle, - string.Format("{0}\r\n{1}", l_oException.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), + string.Format("{0}\r\n{1}", exception.Message, WebConnectFailureException.GetHintToPossibleExceptionsReasons), AppResources.MessageAnswerOk); } else { - Log.ForContext().Error("User selected reserved bike {l_oId} but cancel reservation failed. {@l_oException}.", SelectedBike.Id, l_oException); + Log.ForContext().Error("User selected reserved bike {l_oId} but cancel reservation failed. {@l_oException}.", SelectedBike.Id, exception); await ViewService.DisplayAlert( AppResources.MessageCancelReservationBikeErrorGeneralTitle, - l_oException.Message, + exception.Message, "OK"); } diff --git a/TINKLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/DisposableClosed.cs b/TINKLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/DisposableClosed.cs index 577a0fc..3e0b9c1 100644 --- a/TINKLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/DisposableClosed.cs +++ b/TINKLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/DisposableClosed.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Serilog; using TINK.Model.Bikes.BikeInfoNS.CopriLock; @@ -8,6 +8,7 @@ using TINK.Model.State; using TINK.Model.User; using TINK.MultilingualResources; using TINK.Repository.Exception; +using TINK.Services.CopriApi.Exception; using TINK.View; namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler @@ -170,7 +171,8 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler string.Format(AppResources.MessageReservationBikeErrorTooManyReservationsRentals, SelectedBike.GetFullDisplayName(), (exception as BookingDeclinedException).MaxBikesCount), AppResources.MessageAnswerOk); } - else if (exception is WebConnectFailureException) + else if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected availalbe bike {bike} but reserving failed (Copri server not reachable).", SelectedBike); diff --git a/TINKLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/ReservedClosed.cs b/TINKLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/ReservedClosed.cs index ee539c9..6886688 100644 --- a/TINKLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/ReservedClosed.cs +++ b/TINKLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/ReservedClosed.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Serilog; using TINK.Model.Bikes.BikeInfoNS.CopriLock; @@ -7,6 +7,7 @@ using TINK.Model.Device; using TINK.Model.User; using TINK.MultilingualResources; using TINK.Repository.Exception; +using TINK.Services.CopriApi.Exception; using TINK.View; namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler @@ -101,7 +102,8 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler exception.Message, AppResources.MessageAnswerOk); } - else if (exception is WebConnectFailureException) + else if (exception is WebConnectFailureException + || exception is RequestNotCachableException) { // Copri server is not reachable. Log.ForContext().Information("User selected reserved bike {Id} but cancel reservation failed (Copri server not reachable).", SelectedBike.Id); diff --git a/TINKLib/ViewModel/Settings/FilterItemMutable.cs b/TINKLib/ViewModel/Settings/FilterItemMutable.cs index c3e75f7..42ebae5 100644 --- a/TINKLib/ViewModel/Settings/FilterItemMutable.cs +++ b/TINKLib/ViewModel/Settings/FilterItemMutable.cs @@ -1,10 +1,13 @@ -using TINK.Model; +using System.ComponentModel; +using TINK.Model; namespace TINK.ViewModel.Settings { /// Holds filter item incluting full state (avaialble, activated, name, ...). - public class FilterItemMutable + public class FilterItemMutable : INotifyPropertyChanged { + public event PropertyChangedEventHandler PropertyChanged; + /// Switch value private bool m_bIsActivatedSwitch; @@ -42,6 +45,12 @@ namespace TINK.ViewModel.Settings set { + if (m_bIsActivatedSwitch == value) + { + // Nothing to do. + return; + } + m_bIsActivatedSwitch = value; if (!IsEnabled) { @@ -50,6 +59,7 @@ namespace TINK.ViewModel.Settings } State = m_bIsActivatedSwitch ? FilterState.On : FilterState.Off; + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsActivated))); } } @@ -58,5 +68,6 @@ namespace TINK.ViewModel.Settings /// State of the filter. public FilterState State { get; private set; } + } } diff --git a/TINKLib/ViewModel/Settings/SettingsBikeFilterViewModel.cs b/TINKLib/ViewModel/Settings/SettingsBikeFilterViewModel.cs index 04979cb..e6e593a 100644 --- a/TINKLib/ViewModel/Settings/SettingsBikeFilterViewModel.cs +++ b/TINKLib/ViewModel/Settings/SettingsBikeFilterViewModel.cs @@ -1,5 +1,6 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Collections.ObjectModel; +using System.ComponentModel; using System.Linq; using TINK.Model; using TINK.Model.Connector; @@ -9,8 +10,10 @@ namespace TINK.ViewModel.Settings { /// Holds the filters to display.. /// Former name: FilterCollectionMutable. - public class SettingsBikeFilterViewModel : ObservableCollection + public class SettingsBikeFilterViewModel : ObservableCollection, INotifyPropertyChanged { + public new event PropertyChangedEventHandler PropertyChanged; + /// Constructs a filter collection object. /// All available filters. /// Filters which apply to logged in user. @@ -22,28 +25,35 @@ namespace TINK.ViewModel.Settings { if (filter.Key == FilterHelper.CARGOBIKE) { - Add(new FilterItemMutable( + var cargo = new FilterItemMutable( filter.Key, filter.Value, (filterGroupUser != null && filterGroupUser.Count() > 0) ? filterGroupUser.Contains(filter.Key) : true, - AppResources.MarkingCargoBike)); + AppResources.MarkingCargoBike); + Add(cargo); + + cargo.PropertyChanged += (sender, ev) => PropertyChanged?.Invoke(sender, ev); continue; } if (filter.Key == FilterHelper.CITYBIKE) { - Add(new FilterItemMutable( + var city = new FilterItemMutable( filter.Key, filter.Value, (filterGroupUser != null && filterGroupUser.Count() > 0) ? filterGroupUser.Contains(filter.Key) : true, - AppResources.MarkingCityBike)); + AppResources.MarkingCityBike); + Add(city); + city.PropertyChanged += (sender, ev) => PropertyChanged?.Invoke(sender, ev); continue; } - Add(new FilterItemMutable( + var item = new FilterItemMutable( filter.Key, filter.Value, filterGroupUser != null ? filterGroupUser.Contains(filter.Key) : true, - filter.Key)); + filter.Key); + Add(item); + item.PropertyChanged += (sender, ev) => PropertyChanged?.Invoke(sender, ev); } } diff --git a/TINKLib/ViewModel/Settings/SettingsPageViewModel.cs b/TINKLib/ViewModel/Settings/SettingsPageViewModel.cs index dd5494f..32cd8d9 100644 --- a/TINKLib/ViewModel/Settings/SettingsPageViewModel.cs +++ b/TINKLib/ViewModel/Settings/SettingsPageViewModel.cs @@ -114,6 +114,30 @@ namespace TINK.ViewModel TinkApp.FilterGroupSetting, TinkApp.ActiveUser.IsLoggedIn ? TinkApp.ActiveUser.Group : null); + GroupFilter.PropertyChanged += (s, e) => + { + // Serialize on value changed. On iOS OnDisappearing might not be invoked (when app is directly closed before leaving settings page). + try + { + var filterGroup = GroupFilter.ToDictionary(x => x.Key, x => x.State); + TinkApp.FilterGroupSetting = new GroupFilterSettings(filterGroup.Count > 0 ? filterGroup : null); + + // Update map page filter. + // Reasons for which map page filter has to be updated: + // - user activated/ deactivated a group (cargo/ city bikes) + TinkApp.GroupFilterMapPage = + GroupFilterMapPageHelper.CreateUpdated( + TinkApp.GroupFilterMapPage, + TinkApp.ActiveUser.DoFilter(TinkApp.FilterGroupSetting.DoFilter())); + + TinkApp.Save(); + } + catch (Exception ex) + { + Log.ForContext().Error(ex, "Serializing startup page failed."); + } + }; + m_oViewUpdateManager = new IdlePollingUpdateTaskManager(); Polling = new PollingViewModel(TinkApp.Polling); @@ -166,6 +190,22 @@ namespace TINK.ViewModel { ViewTypes.FindBikePage.ToString(), AppResources.MarkingFindBike }, }, tinkApp.StartupSettings.StartupPage.ToString()); + + StartupSettings.PropertyChanged += (s, e) => + { + // Serialize on value changed. On iOS OnDisappearing might not be invoked (when app is directly closed before leaving settings page). + try + { + TinkApp.StartupSettings.StartupPage = Enum.TryParse(StartupSettings.Active, out ViewTypes startupPage) + ? startupPage + : Model.Settings.StartupSettings.DefaultStartupPage; + + TinkApp.Save(); + } catch (Exception ex) + { + Log.ForContext().Error(ex, "Serializing startup page failed."); + } + }; } /// @@ -234,10 +274,7 @@ namespace TINK.ViewModel /// /// Gets the value of device identifier (for debugging purposes). /// - public string DeviceIdentifier - { - get { return TinkApp.SmartDevice.Identifier; } - } + public string DeviceIdentifier => TinkApp.SmartDevice.Identifier; /// /// Invoked when page is shutdown. @@ -258,22 +295,6 @@ namespace TINK.ViewModel TinkApp.ExpiresAfter = TimeSpan.FromSeconds(ExpiresAfterTotalSeconds); - var filterGroup = GroupFilter.ToDictionary(x => x.Key, x => x.State); - TinkApp.FilterGroupSetting = new GroupFilterSettings(filterGroup.Count > 0 ? filterGroup : null); - - // Update map page filter. - // Reasons for which map page filter has to be updated: - // - user activated/ deactivated a group (TINKCorpi/ TINKSms/ Konrad) - // - user logged off - TinkApp.GroupFilterMapPage = - GroupFilterMapPageHelper.CreateUpdated( - TinkApp.GroupFilterMapPage, - TinkApp.ActiveUser.DoFilter(TinkApp.FilterGroupSetting.DoFilter())); - - TinkApp.StartupSettings.StartupPage = Enum.TryParse(StartupSettings.Active, out ViewTypes startupPage) ? startupPage : Model.Settings.StartupSettings.DefaultStartupPage; - - TinkApp.CenterMapToCurrentLocation = CenterMapToCurrentLocation; - if (IsLogToExternalFolderVisible) { // If no external folder is available do not update model value. @@ -356,7 +377,25 @@ namespace TINK.ViewModel } } - public bool CenterMapToCurrentLocation { get; set; } + bool _CenterMapToCurrentLocation = true; + public bool CenterMapToCurrentLocation + { + get => _CenterMapToCurrentLocation; + set + { + if (value == _CenterMapToCurrentLocation) + { + // Nothing to do. + return; + } + + _CenterMapToCurrentLocation = value; + + // Serialize on value changed. On iOS OnDisappearing might not be invoked (when app is directly closed before leaving settings page). + TinkApp.CenterMapToCurrentLocation = CenterMapToCurrentLocation; + TinkApp.Save(); + } + } /// Holds either /// - a value indicating whether to use external folder (e.g. SD card)/ or internal folder for storing log-files or @@ -408,8 +447,6 @@ namespace TINK.ViewModel public string ExpiresAfterTotalSecondsText { get => expiresAfterTotalSeconds.ToString("0"); - } - - + } } } diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedClosed.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedClosed.cs index 7ac48ef..f0e242d 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedClosed.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedClosed.cs @@ -360,7 +360,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when returning the bike!", - "Internet must be available when returning the bike.\r\nIs WIFI available/ mobile networt available and mobile data activated / ... ?", + "Internet must be available when returning the bike.\r\nIs WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating..."; diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedDisconnected.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedDisconnected.cs index 1182159..e2eea75 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedDisconnected.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedDisconnected.cs @@ -187,7 +187,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Request server..."; bikesViewModel.ActionText = ""; - viewService.DisplayAlert("Error when connecting with lock!", "Internet must be reachable to connect to lock of rented bike.\r\nContext info\r\nIs WIFI available/ mobile networt available and mobile data activated / ... ?", "OK"); + viewService.DisplayAlert("Error when connecting with lock!", "Internet must be reachable to connect to lock of rented bike.\r\nContext info\r\nIs WIFI available/ mobile network available and mobile data activated / ... ?", "OK"); bikesViewModel.ActionText = "Updating..."; pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again bikesViewModel.ActionText = ""; diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedOpen.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedOpen.cs index 9c1ad6d..f88c2ef 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedOpen.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedOpen.cs @@ -296,7 +296,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when returning the bike!", - "Internet must be available when returning the bike.\r\nIs WIFI available/ mobile networt available and mobile data activated / ... ?", + "Internet must be available when returning the bike.\r\nIs WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating..."; @@ -727,7 +727,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when returning the bike!", - "Internet must be available when returning the bike.\r\nIs WIFI available/ mobile networt available and mobile data activated / ... ?", + "Internet must be available when returning the bike.\r\nIs WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating..."; diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableDisconnected.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableDisconnected.cs index 6cf7aca..7e633ff 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableDisconnected.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableDisconnected.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using NSubstitute; using NUnit.Framework; @@ -289,7 +289,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.ActionText = "Reserving bike..."; connector.Command.DoReserve(bike); // Booking must be performed bikesViewModel.ActionText = ""; - viewService.DisplayAlert("Connection error when reserving the bike!", "Context info.\r\nIs WIFI available/ mobile networt available and mobile data activated / ... ?", "OK"); + viewService.DisplayAlert("Connection error when reserving the bike!", "Context info.\r\nIs WIFI available/ mobile network available and mobile data activated / ... ?", "OK"); bikesViewModel.ActionText = "Updating..."; pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again bikesViewModel.ActionText = ""; diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableOpen.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableOpen.cs index 327735a..03d86cd 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableOpen.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableOpen.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using NSubstitute; using NUnit.Framework; @@ -349,7 +349,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.ActionText = ""; viewService.DisplayAlert( "Connection error when renting the bike!", - string.Format("Attention: Lock is closed!\r\n{0}\r\n{1}", "Context info.", "Is WIFI available/ mobile networt available and mobile data activated / ... ?"), + string.Format("Attention: Lock is closed!\r\n{0}\r\n{1}", "Context info.", "Is WIFI available/ mobile network available and mobile data activated / ... ?"), "OK"); bikesViewModel.ActionText = "Verschließe Schloss..."; locks[0].CloseAsync(); diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedClosed.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedClosed.cs index 554b8dd..368b3c8 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedClosed.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedClosed.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Newtonsoft.Json; using NSubstitute; @@ -293,7 +293,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.ActionText = ""; viewService.DisplayAlert( "Connection error when canceling the reservation!", - "Context info.\r\nIs WIFI available/ mobile networt available and mobile data activated / ... ?", + "Context info.\r\nIs WIFI available/ mobile network available and mobile data activated / ... ?", "OK"); bikesViewModel.ActionText = "Updating..."; pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again @@ -545,7 +545,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when renting the bike!", - "Is WIFI available/ mobile networt available and mobile data activated / ... ?", + "Is WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating..."; diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedDisconnected.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedDisconnected.cs index 9506da7..9b30bbd 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedDisconnected.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedDisconnected.cs @@ -283,7 +283,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.ActionText = ""; viewService.DisplayAlert( "Connection error when canceling the reservation!", - "Context info\r\nIs WIFI available/ mobile networt available and mobile data activated / ... ?", + "Context info\r\nIs WIFI available/ mobile network available and mobile data activated / ... ?", "OK"); bikesViewModel.ActionText = "Updating..."; pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again @@ -486,7 +486,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Request server..."; bikesViewModel.ActionText = ""; - viewService.DisplayAlert("Error when connecting to lock!", "Internet must be reachable to connect to lock of reserved bike.\r\nContext info.\r\nIs WIFI available/ mobile networt available and mobile data activated / ... ?", "OK"); + viewService.DisplayAlert("Error when connecting to lock!", "Internet must be reachable to connect to lock of reserved bike.\r\nContext info.\r\nIs WIFI available/ mobile network available and mobile data activated / ... ?", "OK"); bikesViewModel.ActionText = "Updating..."; pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again bikesViewModel.ActionText = ""; diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedOpen.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedOpen.cs index 343c5b0..3bb8366 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedOpen.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedOpen.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Newtonsoft.Json; using NSubstitute; @@ -160,7 +160,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.ActionText = ""; viewService.DisplayAlert( "Connection error when renting the bike!", - string.Format("Attention: Lock is closed!\r\n{0}\r\n{1}", "Context info.", "Is WIFI available/ mobile networt available and mobile data activated / ... ?"), + string.Format("Attention: Lock is closed!\r\n{0}\r\n{1}", "Context info.", "Is WIFI available/ mobile network available and mobile data activated / ... ?"), "OK"); bikesViewModel.ActionText = "Wiederverschließe Schloss..."; locks[0].CloseAsync(); @@ -590,7 +590,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.ActionText = ""; viewService.DisplayAlert( "Connection error when canceling the reservation!", - "Context info\r\nIs WIFI available/ mobile networt available and mobile data activated / ... ?", + "Context info\r\nIs WIFI available/ mobile network available and mobile data activated / ... ?", "OK"); bikesViewModel.ActionText = "Updating..."; pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again diff --git a/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestBookedClosed.cs b/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestBookedClosed.cs index 9718ef0..aae2594 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestBookedClosed.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestBookedClosed.cs @@ -1,4 +1,4 @@ -using System; +using System; using NSubstitute; using NUnit.Framework; using TINK.Model.Bikes.BikeInfoNS.CopriLock; @@ -62,7 +62,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.CopriLock.RequestHandler bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when opening the lock!", - "Is WIFI available/ mobile networt available and mobile data activated / ... ?", + "Is WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating..."; diff --git a/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestBookedOpen.cs b/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestBookedOpen.cs index 318ae44..6a65b44 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestBookedOpen.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestBookedOpen.cs @@ -1,4 +1,4 @@ -using System; +using System; using NSubstitute; using NUnit.Framework; using TINK.Model.Bikes.BikeInfoNS.CopriLock; @@ -62,7 +62,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.CopriLock.RequestHandler bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when opening the lock!", - "Is WIFI available/ mobile networt available and mobile data activated / ... ?", + "Is WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating..."; diff --git a/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestDisposableClosed.cs b/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestDisposableClosed.cs index 1f04ee9..b28d320 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestDisposableClosed.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestDisposableClosed.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using NSubstitute; using NUnit.Framework; @@ -130,7 +130,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.CopriLock.RequestHandler bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when renting the bike!", - "Is WIFI available/ mobile networt available and mobile data activated / ... ?", + "Is WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating..."; @@ -486,7 +486,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.CopriLock.RequestHandler bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when reserving the bike!", - "Is WIFI available/ mobile networt available and mobile data activated / ... ?", + "Is WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating..."; diff --git a/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestReservedClosed.cs b/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestReservedClosed.cs index c0d20f3..c2b95a7 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestReservedClosed.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/CopriLock/RequestHandler/TestReservedClosed.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Newtonsoft.Json; using NSubstitute; @@ -197,7 +197,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.CopriLock.RequestHandler bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when canceling the reservation!", - "Is WIFI available/ mobile networt available and mobile data activated / ... ?", + "Is WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating..."; @@ -472,7 +472,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.CopriLock.RequestHandler bikesViewModel.ActionText = ""; viewService.DisplayAdvancedAlert( "Connection error when renting the bike!", - "Is WIFI available/ mobile networt available and mobile data activated / ... ?", + "Is WIFI available/ mobile network available and mobile data activated / ... ?", "Context info", "OK"); bikesViewModel.ActionText = "Updating...";