mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-21 21:46:27 +02:00
Version 3.0.363
This commit is contained in:
parent
4ff3307997
commit
91d42552c7
212 changed files with 1799 additions and 1318 deletions
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -49,8 +49,8 @@ namespace TINK.ViewModel.Account
|
|||
/// <param name="p_oDevice"></param>
|
||||
/// <param name="p_oFilterGroup">Filter to apply on stations and bikes.</param>
|
||||
/// <param name="p_oUris">Available copri server host uris including uri to use for next start.</param>
|
||||
/// <param name="p_oPolling"> Holds whether to poll or not and the periode leght is polling is on. </param>
|
||||
/// <param name="p_oDefaultPollingPeriode">Default polling periode lenght.</param>
|
||||
/// <param name="p_oPolling"> Holds whether to poll or not and the period length is polling is on. </param>
|
||||
/// <param name="p_oDefaultPollingPeriode">Default polling period length.</param>
|
||||
/// <param name="p_oMinimumLogEventLevel">Controls logging level.</param>
|
||||
/// <param name="viewService">Interface to view</param>
|
||||
public AccountPageViewModel(
|
||||
|
@ -159,7 +159,7 @@ namespace TINK.ViewModel.Account
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether booking state info is avilable or not.
|
||||
/// Gets a value indicating whether booking state info is available or not.
|
||||
/// </summary>
|
||||
public bool IsBookingStateInfoVisible
|
||||
{
|
||||
|
@ -429,7 +429,7 @@ namespace TINK.ViewModel.Account
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>Polling periode.</summary>
|
||||
/// <summary>Polling period.</summary>
|
||||
public PollingViewModel Polling { get; }
|
||||
|
||||
/// <summary> Opens login page.</summary>
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
|
|||
if (l_oResult == false)
|
||||
{
|
||||
// User aborted booking process
|
||||
Log.ForContext<Disposable>().Information("User selected availalbe bike {l_oId} in order to reserve but action was canceled.", SelectedBike.Id);
|
||||
Log.ForContext<Disposable>().Information("User selected centered bike {l_oId} in order to reserve but action was canceled.", SelectedBike.Id);
|
||||
BikesViewModel.IsIdle = true;
|
||||
return this;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
|
|||
|| exception is RequestNotCachableException)
|
||||
{
|
||||
// Copri server is not reachable.
|
||||
Log.ForContext<Disposable>().Information("User selected availalbe bike {l_oId} but reserving failed (Copri server not reachable).", SelectedBike.Id);
|
||||
Log.ForContext<Disposable>().Information("User selected centered bike {l_oId} but reserving failed (Copri server not reachable).", SelectedBike.Id);
|
||||
|
||||
BikesViewModel.ActionText = string.Empty;
|
||||
await ViewService.DisplayAlert(
|
||||
|
@ -87,7 +87,7 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
|
|||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<Disposable>().Error("User selected availalbe bike {l_oId} but reserving failed. {@l_oException}", SelectedBike.Id, exception);
|
||||
Log.ForContext<Disposable>().Error("User selected centered bike {l_oId} but reserving failed. {@l_oException}", SelectedBike.Id, exception);
|
||||
|
||||
BikesViewModel.ActionText = string.Empty;
|
||||
await ViewService.DisplayAlert(AppResources.MessageReservingBikeErrorGeneralTitle, exception.Message, AppResources.MessageAnswerOk);
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace TINK.ViewModel.Bikes.Bike.BC.RequestHandler
|
|||
|
||||
await ConnectorFactory(IsConnected).Command.DoCancelReservation(SelectedBike);
|
||||
|
||||
// If canceling bike succedes remove bike because it is not ready to be booked again
|
||||
// If canceling bike succeeds remove bike because it is not ready to be booked again
|
||||
IsRemoveBikeRequired = true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.User;
|
||||
|
@ -37,7 +37,7 @@ namespace TINK.ViewModel.Bikes.Bike.BC
|
|||
activeUser);
|
||||
|
||||
case Model.State.InUseStateEnum.Reserved:
|
||||
// Reservation can be cancelled.
|
||||
// Reservation can be canceled.
|
||||
return new Reserved(
|
||||
selectedBike,
|
||||
isConnectedDelegate,
|
||||
|
|
|
@ -2,6 +2,7 @@ using Serilog;
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Text.RegularExpressions;
|
||||
using TINK.Model.Bikes.BikeInfoNS.BikeNS;
|
||||
#if !USEFLYOUT
|
||||
#endif
|
||||
using TINK.Model.Connector;
|
||||
|
@ -38,7 +39,7 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
/// </summary>
|
||||
protected IViewService ViewService { get; }
|
||||
|
||||
/// <summary> Provides a connect orobject.</summary>
|
||||
/// <summary> Provides a connect object.</summary>
|
||||
protected Func<bool, IConnector> ConnectorFactory { get; }
|
||||
|
||||
/// <summary> Delegate to retrieve connected state. </summary>
|
||||
|
@ -75,7 +76,7 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
public abstract event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Notfies childs about changed bike state.
|
||||
/// Notifies children about changed bike state.
|
||||
/// </summary>
|
||||
public abstract void OnSelectedBikeStateChanged();
|
||||
|
||||
|
@ -175,6 +176,11 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
|
||||
public string TypeOfBike => Bike.GetDisplayTypeOfBike();
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether bike is a AA bike (bike must be always returned a the same station) or AB bike (start and end stations can be different stations).
|
||||
/// </summary>
|
||||
public AaRideType? AaRideType => Bike.AaRideType;
|
||||
|
||||
public string WheelType => Bike.GetDisplayWheelType();
|
||||
|
||||
/// <summary>
|
||||
|
@ -187,6 +193,8 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
/// </summary>
|
||||
public string Id => Bike.Id;
|
||||
|
||||
public string StationId => $"Station {Bike.StationId}";
|
||||
|
||||
public bool IsBikeWithCopriLock => Bike.LockModel == Model.Bikes.BikeInfoNS.BikeNS.LockModel.Sigo;
|
||||
|
||||
/// Returns if type of bike is a cargo pedelec bike.
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock
|
|||
public class BikeViewModel : BikeViewModelBase, INotifyPropertyChanged
|
||||
{
|
||||
public Xamarin.Forms.Command ShowTrackingInfoCommand { get; private set; }
|
||||
public Xamarin.Forms.Command ShowRideTypeInfoCommand { get; private set; }
|
||||
|
||||
/// <summary> Notifies GUI about changes. </summary>
|
||||
public override event PropertyChangedEventHandler PropertyChanged;
|
||||
|
@ -112,6 +113,15 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock
|
|||
|
||||
});
|
||||
|
||||
ShowRideTypeInfoCommand = new Xamarin.Forms.Command(async () => {
|
||||
|
||||
await ViewService.DisplayAlert(
|
||||
AppResources.MessageAaRideTypeInfoTitle,
|
||||
TariffDescription.RideTypeText,
|
||||
AppResources.MessageAnswerOk);
|
||||
|
||||
});
|
||||
|
||||
RequestHandler = user.IsLoggedIn
|
||||
? RequestHandlerFactory.Create(
|
||||
selectedBike,
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
return RequestHandlerFactory.Create(SelectedBike, IsConnectedDelegate, ConnectorFactory, GeolocationService, LockService, ViewUpdateManager, SmartDevice, ViewService, BikesViewModel, ActiveUser);
|
||||
}
|
||||
|
||||
// Check if quering geolocation is required.
|
||||
// Check if querying geolocation is required.
|
||||
if (currentLocation == null)
|
||||
{
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextQueryLocationStart;
|
||||
|
@ -216,7 +216,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
SelectedBike,
|
||||
currentLocationDto);
|
||||
|
||||
// If canceling bike succedes remove bike because it is not ready to be booked again
|
||||
// If canceling bike succeeds remove bike because it is not ready to be booked again
|
||||
IsRemoveBikeRequired = true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
@ -238,7 +238,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
// COPRI returned an error.
|
||||
Log.ForContext<BookedClosed>().Information(
|
||||
"User selected booked bike {bike} but returning failed. COPRI returned out of GEO fencing error. Postion send to COPRI {@position}.",
|
||||
"User selected booked bike {bike} but returning failed. COPRI returned out of GEO fencing error. Position send to COPRI {@position}.",
|
||||
SelectedBike,
|
||||
currentLocationDto);
|
||||
|
||||
|
@ -427,7 +427,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
"OK");
|
||||
}
|
||||
|
||||
// When bold is blocked lock is still closed even if exception occurres.
|
||||
// When bold is blocked lock is still closed even if exception occurs.
|
||||
// In all other cases state is supposed to be unknown. Example: Lock is out of reach and no more bluetooth connected.
|
||||
SelectedBike.LockInfo.State = exception is StateAwareException stateAwareException
|
||||
? stateAwareException.State
|
||||
|
@ -449,13 +449,13 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
if (exception is OutOfReachException)
|
||||
{
|
||||
Log.ForContext<BookedClosed>().Debug("Akkustate can not be read, bike out of range. {Exception}", exception);
|
||||
Log.ForContext<BookedClosed>().Debug("Battery state can not be read, bike out of range. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelOutOfReach;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<BookedClosed>().Error("Akkustate can not be read. {Exception}", exception);
|
||||
Log.ForContext<BookedClosed>().Error("Battery state can not be read. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelGeneral;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
/// <returns></returns>
|
||||
public async Task<IRequestHandler> HandleRequestOption2() => await ConnectLock();
|
||||
|
||||
/// <summary> Requst is not supported, button should be disabled. </summary>
|
||||
/// <summary> Request is not supported, button should be disabled. </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IRequestHandler> UnsupportedRequest()
|
||||
{
|
||||
|
|
|
@ -119,11 +119,11 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
return this;
|
||||
}
|
||||
|
||||
// Start of closing lock and returing bike sequence.
|
||||
// Start of closing lock and returning bike sequence.
|
||||
Log.ForContext<BookedOpen>().Information("Request to return bike {bike} detected.", SelectedBike);
|
||||
|
||||
// Clear logging memory sink to avoid passing log data not related to returning of bike to backend.
|
||||
// Log data is passed to backend when calling CopriCallsHttps.DoReturn().
|
||||
// Clear logging memory sink to avoid passing log data not related to returning of bike to back-end.
|
||||
// Log data is passed to back end when calling CopriCallsHttps.DoReturn().
|
||||
MemoryStackSink.ClearMessages();
|
||||
|
||||
// Stop polling before returning bike.
|
||||
|
@ -260,7 +260,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
// Check locking state.
|
||||
if (SelectedBike.LockInfo.State != LockingState.Closed)
|
||||
{
|
||||
Log.ForContext<BookedOpen>().Error($"Lock can not be closed. Invalid locking state state {SelectedBike.LockInfo.State} detected.");
|
||||
Log.ForContext<BookedOpen>().Error($"Lock can not be closed. Invalid locking state {SelectedBike.LockInfo.State} detected.");
|
||||
|
||||
BikesViewModel.ActionText = string.Empty;
|
||||
|
||||
|
@ -298,7 +298,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
catch (Exception innerExWhenAll)
|
||||
{
|
||||
// No location information available.
|
||||
Log.ForContext<BookedOpen>().Information("Canceling query location/ updating lock state failed failed on unexpected lock state failed. {Exception}", SelectedBike, innerExWhenAll);
|
||||
Log.ForContext<BookedOpen>().Information("Canceling query location/ updating lock state failed on unexpected lock state failed. {Exception}", SelectedBike, innerExWhenAll);
|
||||
}
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextStartingUpdater;
|
||||
|
@ -360,7 +360,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
SelectedBike,
|
||||
currentLocationDto,
|
||||
SmartDevice);
|
||||
// If canceling bike succedes remove bike because it is not ready to be booked again
|
||||
// If canceling bike succeeds remove bike because it is not ready to be booked again
|
||||
IsRemoveBikeRequired = true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
@ -382,7 +382,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
// COPRI returned an error.
|
||||
Log.ForContext<BookedOpen>().Information(
|
||||
"User selected booked bike {bike} but returning failed. COPRI returned out of GEO fencing error. Postion send to COPRI {@position}.",
|
||||
"User selected booked bike {bike} but returning failed. COPRI returned out of GEO fencing error. Position send to COPRI {@position}.",
|
||||
SelectedBike,
|
||||
currentLocationDto);
|
||||
|
||||
|
@ -510,8 +510,8 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
BikesViewModel.IsIdle = false;
|
||||
Log.ForContext<BookedOpen>().Information("User request to lock bike {bike} in order to pause ride.", SelectedBike);
|
||||
|
||||
// Clear logging memory sink to avoid passing log data not related to returning of bike to backend.
|
||||
// Log data is passed to backend when calling CopriCallsHttps.DoReturn().
|
||||
// Clear logging memory sink to avoid passing log data not related to returning of bike to back end.
|
||||
// Log data is passed to back end when calling CopriCallsHttps.DoReturn().
|
||||
MemoryStackSink.ClearMessages();
|
||||
|
||||
// Start getting geolocation.
|
||||
|
@ -608,7 +608,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
return RequestHandlerFactory.Create(SelectedBike, IsConnectedDelegate, ConnectorFactory, GeolocationService, LockService, ViewUpdateManager, SmartDevice, ViewService, BikesViewModel, ActiveUser);
|
||||
}
|
||||
|
||||
// Get geoposition.
|
||||
// Get geolocation.
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextQueryLocation;
|
||||
IGeolocation currentLocation = null;
|
||||
try
|
||||
|
|
|
@ -14,7 +14,6 @@ using TINK.Services.BluetoothLock;
|
|||
using TINK.Services.BluetoothLock.Exception;
|
||||
using TINK.Services.Geolocation;
|
||||
using TINK.View;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||
{
|
||||
|
@ -126,7 +125,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
AppResources.MessageAnswerOk);
|
||||
}
|
||||
|
||||
// When bold is blocked lock is still closed even if exception occurres.
|
||||
// When bold is blocked lock is still closed even if exception occurs.
|
||||
// In all other cases state is supposed to be unknown. Example: Lock is out of reach and no more bluetooth connected.
|
||||
SelectedBike.LockInfo.State = exception is StateAwareException stateAwareException
|
||||
? stateAwareException.State
|
||||
|
@ -148,13 +147,13 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
if (exception is OutOfReachException)
|
||||
{
|
||||
Log.ForContext<BookedUnknown>().Debug("Akkustate can not be read, bike out of range. {Exception}", exception);
|
||||
Log.ForContext<BookedUnknown>().Debug("Battery state can not be read, bike out of range. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelOutOfReach;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<BookedUnknown>().Error("Akkustate can not be read. {Exception}", exception);
|
||||
Log.ForContext<BookedUnknown>().Error("Battery state can not be read. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelGeneral;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
if (alertResult == false)
|
||||
{
|
||||
// User aborted booking process
|
||||
Log.ForContext<DisposableDisconnected>().Information("User selected availalbe bike {bike} in order to reserve but action was canceled.", SelectedBike);
|
||||
Log.ForContext<DisposableDisconnected>().Information("User selected centered bike {bike} in order to reserve but action was canceled.", SelectedBike);
|
||||
BikesViewModel.IsIdle = true;
|
||||
return this;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
|| exception is RequestNotCachableException)
|
||||
{
|
||||
// Copri server is not reachable.
|
||||
Log.ForContext<DisposableDisconnected>().Information("User selected availalbe bike {bike} but reserving failed (Copri server not reachable).", SelectedBike);
|
||||
Log.ForContext<DisposableDisconnected>().Information("User selected centered bike {bike} but reserving failed (Copri server not reachable).", SelectedBike);
|
||||
|
||||
await ViewService.DisplayAlert(
|
||||
AppResources.MessageReservingBikeErrorConnectionTitle,
|
||||
|
@ -115,7 +115,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<DisposableDisconnected>().Error("User selected availalbe bike {bike} but reserving failed. {@l_oException}", SelectedBike, exception);
|
||||
Log.ForContext<DisposableDisconnected>().Error("User selected centered bike {bike} but reserving failed. {@l_oException}", SelectedBike, exception);
|
||||
|
||||
await ViewService.DisplayAlert(
|
||||
AppResources.MessageReservingBikeErrorGeneralTitle,
|
||||
|
@ -346,13 +346,13 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
if (exception is OutOfReachException)
|
||||
{
|
||||
Log.ForContext<DisposableDisconnected>().Debug("Akkustate can not be read, bike out of range. {Exception}", exception);
|
||||
Log.ForContext<DisposableDisconnected>().Debug("Battery state can not be read, bike out of range. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelOutOfReach;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<DisposableDisconnected>().Error("Akkustate can not be read. {Exception}", exception);
|
||||
Log.ForContext<DisposableDisconnected>().Error("Battery state can not be read. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelGeneral;
|
||||
}
|
||||
|
@ -407,7 +407,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
return RequestHandlerFactory.Create(SelectedBike, IsConnectedDelegate, ConnectorFactory, GeolocationService, LockService, ViewUpdateManager, SmartDevice, ViewService, BikesViewModel, ActiveUser);
|
||||
}
|
||||
|
||||
/// <summary> Requst is not supported, button should be disabled. </summary>
|
||||
/// <summary> Request is not supported, button should be disabled. </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IRequestHandler> UnsupportedRequest()
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||
|
@ -26,7 +26,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
/// <summary> Bike is disposable, lock is open and can be reached via bluetooth. </summary>
|
||||
/// <remarks>
|
||||
/// This state should never occure because as long as a ILOCKIT is connected it
|
||||
/// This state should never occur because as long as a ILOCKIT is connected it
|
||||
/// - cannot be closed manually
|
||||
/// - no other device can access lock
|
||||
/// - app itself should never event attempt to open a lock which is not rented.
|
||||
|
@ -177,19 +177,19 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
if (exception is OutOfReachException)
|
||||
{
|
||||
Log.ForContext<DisposableOpen>().Debug("Akkustate can not be read, bike out of range. {Exception}", exception);
|
||||
Log.ForContext<DisposableOpen>().Debug("Battery state can not be read, bike out of range. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelOutOfReach;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<DisposableOpen>().Error("Akkustate can not be read. {Exception}", exception);
|
||||
Log.ForContext<DisposableOpen>().Error("Battery state can not be read. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelGeneral;
|
||||
}
|
||||
}
|
||||
|
||||
// Notify corpi about unlock action in order to start booking.
|
||||
// Notify copri about unlock action in order to start booking.
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextRentingBike;
|
||||
IsConnected = IsConnectedDelegate();
|
||||
try
|
||||
|
@ -270,7 +270,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
return RequestHandlerFactory.Create(SelectedBike, IsConnectedDelegate, ConnectorFactory, GeolocationService, LockService, ViewUpdateManager, SmartDevice, ViewService, BikesViewModel, ActiveUser);
|
||||
}
|
||||
|
||||
/// <summary> Requst is not supported, button should be disabled. </summary>
|
||||
/// <summary> Request is not supported, button should be disabled. </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IRequestHandler> UnsupportedRequest()
|
||||
{
|
||||
|
|
|
@ -16,11 +16,11 @@ using IBikeInfoMutable = TINK.Model.Bikes.BikeInfoNS.BluetoothLock.IBikeInfoMuta
|
|||
|
||||
namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||
{
|
||||
/// <summary> Bike is reserved, lock is closed and and connected to app. </summary>
|
||||
/// <summary> Bike is reserved, lock is closed and connected to app. </summary>
|
||||
/// <remarks>
|
||||
/// Occures when
|
||||
/// - biks was reserved out of reach and is in reach now
|
||||
/// - bike is is reserved while in reach
|
||||
/// Occurs when
|
||||
/// - bike was reserved out of reach and is in reach now
|
||||
/// - bike is reserved while in reach
|
||||
/// </remarks>
|
||||
public class ReservedClosed : Base, IRequestHandler
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
await ConnectorFactory(IsConnected).Command.DoCancelReservation(SelectedBike);
|
||||
|
||||
// If canceling bike succedes remove bike because it is not ready to be booked again
|
||||
// If canceling bike succeeds remove bike because it is not ready to be booked again
|
||||
IsRemoveBikeRequired = true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
@ -311,13 +311,13 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
if (exception is OutOfReachException)
|
||||
{
|
||||
Log.ForContext<ReservedClosed>().Debug("Akkustate can not be read, bike out of range. {Exception}", exception);
|
||||
Log.ForContext<ReservedClosed>().Debug("Battery state can not be read, bike out of range. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelOutOfReach;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<ReservedClosed>().Error("Akkustate can not be read. {Exception}", exception);
|
||||
Log.ForContext<ReservedClosed>().Error("Battery state can not be read. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelGeneral;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
/// <summary> Cancel reservation. </summary>
|
||||
public async Task<IRequestHandler> HandleRequestOption1() => await CancelReservation();
|
||||
|
||||
/// <summary> Connect to reserved bike ask whether to book bike bike or not and if yes open lock. </summary>
|
||||
/// <summary> Connect to reserved bike ask whether to book bike or not and if yes open lock. </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IRequestHandler> HandleRequestOption2() => await ConnectLockAndBook();
|
||||
|
||||
|
@ -86,7 +86,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
await ConnectorFactory(IsConnected).Command.DoCancelReservation(SelectedBike);
|
||||
|
||||
// If canceling bike succedes remove bike because it is not ready to be booked again
|
||||
// If canceling bike succeeds remove bike because it is not ready to be booked again
|
||||
IsRemoveBikeRequired = true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
@ -136,7 +136,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
return RequestHandlerFactory.Create(SelectedBike, IsConnectedDelegate, ConnectorFactory, GeolocationService, LockService, ViewUpdateManager, SmartDevice, ViewService, BikesViewModel, ActiveUser);
|
||||
}
|
||||
|
||||
/// <summary> Connect to reserved bike ask whether to book bike bike or not and if yes open lock. </summary>
|
||||
/// <summary> Connect to reserved bike ask whether to book bike or not and if yes open lock. </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IRequestHandler> ConnectLockAndBook()
|
||||
{
|
||||
|
@ -474,13 +474,13 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
if (exception is OutOfReachException)
|
||||
{
|
||||
Log.ForContext<ReservedDisconnected>().Debug("Akkustate can not be read, bike out of range. {Exception}", exception);
|
||||
Log.ForContext<ReservedDisconnected>().Debug("Battery state can not be read, bike out of range. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelOutOfReach;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<ReservedDisconnected>().Error("Akkustate can not be read. {Exception}", exception);
|
||||
Log.ForContext<ReservedDisconnected>().Error("Battery state can not be read. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelGeneral;
|
||||
}
|
||||
|
|
|
@ -17,10 +17,10 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
/// <summary> Bike is reserved, lock is open and connected to app. </summary>
|
||||
/// <remarks>
|
||||
/// This state might occure when a ILOCKIT was manually opened (color code) and app connects afterwards.
|
||||
/// This state might occur when a ILOCKIT was manually opened (color code) and app connects afterwards.
|
||||
/// This should never during ILOCKIT is connected to app because
|
||||
/// - manually opening lock is not possible when lock is connected
|
||||
/// - two devices can not simultaneously conect to same lock.
|
||||
/// - two devices can not simultaneously connect to same lock.
|
||||
public class ReservedOpen : Base, IRequestHandler
|
||||
{
|
||||
/// <param name="smartDevice">Provides info about the smart device (phone, tablet, ...)</param>
|
||||
|
@ -89,13 +89,13 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
if (exception is OutOfReachException)
|
||||
{
|
||||
Log.ForContext<ReservedOpen>().Debug("Akkustate can not be read, bike out of range. {Exception}", exception);
|
||||
Log.ForContext<ReservedOpen>().Debug("Battery state can not be read, bike out of range. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelOutOfReach;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<ReservedOpen>().Error("Akkustate can not be read. {Exception}", exception);
|
||||
Log.ForContext<ReservedOpen>().Error("Battery state can not be read. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelGeneral;
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
await ConnectorFactory(IsConnected).Command.DoCancelReservation(SelectedBike);
|
||||
|
||||
// If canceling bike succedes remove bike because it is not ready to be booked again
|
||||
// If canceling bike succeeds remove bike because it is not ready to be booked again
|
||||
IsRemoveBikeRequired = true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
AppResources.MessageAnswerOk);
|
||||
}
|
||||
|
||||
// When bold is blocked lock is still closed even if exception occurres.
|
||||
// When bold is blocked lock is still closed even if exception occurs.
|
||||
// In all other cases state is supposed to be unknown. Example: Lock is out of reach and no more bluetooth connected.
|
||||
SelectedBike.LockInfo.State = exception is StateAwareException stateAwareException
|
||||
? stateAwareException.State
|
||||
|
@ -144,13 +144,13 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
{
|
||||
if (exception is OutOfReachException)
|
||||
{
|
||||
Log.ForContext<ReservedUnknown>().Debug("Akkustate can not be read, bike out of range. {Exception}", exception);
|
||||
Log.ForContext<ReservedUnknown>().Debug("Battery state can not be read, bike out of range. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelOutOfReach;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<ReservedUnknown>().Error("Akkustate can not be read. {Exception}", exception);
|
||||
Log.ForContext<ReservedUnknown>().Error("Battery state can not be read. {Exception}", exception);
|
||||
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextErrorReadingChargingLevelGeneral;
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
return RequestHandlerFactory.Create(SelectedBike, IsConnectedDelegate, ConnectorFactory, GeolocationService, LockService, ViewUpdateManager, SmartDevice, ViewService, BikesViewModel, ActiveUser);
|
||||
}
|
||||
|
||||
// Get geoposition.
|
||||
// Get geolocation.
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextQueryLocation;
|
||||
IGeolocation currentLocation = null;
|
||||
try
|
||||
|
|
|
@ -43,11 +43,11 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock
|
|||
{
|
||||
case Model.State.InUseStateEnum.Disposable:
|
||||
|
||||
// Bike is reserved, selecte action depending on lock state.
|
||||
// Bike is reserved, select action depending on lock state.
|
||||
switch (selectedBluetoothLockBike.LockInfo.State)
|
||||
{
|
||||
case LockingState.Closed:
|
||||
// Unexepected state detected.
|
||||
// Unexpected state detected.
|
||||
// This state is unexpected because connection is closed
|
||||
// - when reservation is canceled or
|
||||
// - when bike is returned.
|
||||
|
@ -60,13 +60,13 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock
|
|||
|
||||
case LockingState.Open:
|
||||
case LockingState.UnknownFromHardwareError:
|
||||
// Unexepected state detected.
|
||||
// Unexpected state detected.
|
||||
/// This state is unexpected because
|
||||
/// - app does not allow to return bike/ cancel reservation when lock is closed
|
||||
/// - as long as app is connected to lock
|
||||
/// - lock can not be opened manually
|
||||
/// - no other device can access lock
|
||||
/// Nevetheless this state is not expected let user either
|
||||
/// Nevertheless this state is not expected let user either
|
||||
/// - close lock or
|
||||
/// - rent bike
|
||||
/// </remarks>
|
||||
|
@ -100,7 +100,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock
|
|||
|
||||
case Model.State.InUseStateEnum.Reserved:
|
||||
|
||||
// Bike is reserved, selecte action depending on lock state.
|
||||
// Bike is reserved, select action depending on lock state.
|
||||
switch (selectedBluetoothLockBike.LockInfo.State)
|
||||
{
|
||||
case LockingState.Closed:
|
||||
|
@ -132,7 +132,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock
|
|||
|
||||
case LockingState.Open:
|
||||
// Unwanted state detected.
|
||||
/// This state might occure when a ILOCKIT was manually opened (color code) and app connects afterwards.
|
||||
/// This state might occur when a ILOCKIT was manually opened (color code) and app connects afterwards.
|
||||
Log.Error("Unwanted state {BookingState}/ {LockingState} detected.", selectedBluetoothLockBike.State.Value, selectedBluetoothLockBike.LockInfo.State);
|
||||
return new ReservedOpen(
|
||||
selectedBluetoothLockBike,
|
||||
|
@ -167,7 +167,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock
|
|||
|
||||
case Model.State.InUseStateEnum.Booked:
|
||||
|
||||
// Bike is booked, selecte action depending on lock state.
|
||||
// Bike is booked, select action depending on lock state.
|
||||
switch (selectedBluetoothLockBike.LockInfo.State)
|
||||
{
|
||||
case LockingState.Closed:
|
||||
|
@ -214,7 +214,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock
|
|||
|
||||
default:
|
||||
// Invalid state detected.
|
||||
// If bike is booked lock state must be querried before creating view model.
|
||||
// If bike is booked lock state must be queried before creating view model.
|
||||
return new BookedDisconnected(
|
||||
selectedBluetoothLockBike,
|
||||
isConnectedDelegate,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
using TINK.Model.Bikes.BikeInfoNS.CopriLock;
|
||||
|
@ -47,7 +47,7 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
/// <summary> Open bike and update COPRI lock state. </summary>
|
||||
public async Task<IRequestHandler> HandleRequestOption2() => await OpenLock();
|
||||
|
||||
/// <summary> Requst is not supported, button should be disabled. </summary>
|
||||
/// <summary> Request is not supported, button should be disabled. </summary>
|
||||
public async Task<IRequestHandler> UnsupportedRequest()
|
||||
{
|
||||
Log.ForContext<BookedClosed>().Error("Click of unsupported button click detected.");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
using TINK.Model.Bikes.BikeInfoNS.CopriLock;
|
||||
|
@ -48,7 +48,7 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
/// <summary> Close lock in order to pause ride and update COPRI lock state.</summary>
|
||||
public async Task<IRequestHandler> HandleRequestOption2() => await OpenLock();
|
||||
|
||||
/// <summary> Requst is not supported, button should be disabled. </summary>
|
||||
/// <summary> Request is not supported, button should be disabled. </summary>
|
||||
public async Task<IRequestHandler> UnsupportedRequest()
|
||||
{
|
||||
Log.ForContext<BookedOpen>().Error("Click of unsupported button click detected.");
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
if (alertResult == false)
|
||||
{
|
||||
// User aborted booking process
|
||||
Log.ForContext<DisposableClosed>().Information("User selected bike {bike} in order to book and release bike from station but action was cancelled.", SelectedBike);
|
||||
Log.ForContext<DisposableClosed>().Information("User selected bike {bike} in order to book and release bike from station but action was canceled.", SelectedBike);
|
||||
|
||||
BikesViewModel.IsIdle = true;
|
||||
return this;
|
||||
|
@ -139,7 +139,7 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
if (alertResult == false)
|
||||
{
|
||||
// User aborted booking process
|
||||
Log.ForContext<DisposableClosed>().Information("User selected availalbe bike {bike} in order to reserve but action was canceled.", SelectedBike);
|
||||
Log.ForContext<DisposableClosed>().Information("User selected centered bike {bike} in order to reserve but action was canceled.", SelectedBike);
|
||||
BikesViewModel.IsIdle = true;
|
||||
return this;
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
|| exception is RequestNotCachableException)
|
||||
{
|
||||
// Copri server is not reachable.
|
||||
Log.ForContext<DisposableClosed>().Information("User selected availalbe bike {bike} but reserving failed (Copri server not reachable).", SelectedBike);
|
||||
Log.ForContext<DisposableClosed>().Information("User selected centered bike {bike} but reserving failed (Copri server not reachable).", SelectedBike);
|
||||
|
||||
await ViewService.DisplayAdvancedAlert(
|
||||
AppResources.MessageReservingBikeErrorConnectionTitle,
|
||||
|
@ -185,7 +185,7 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<DisposableClosed>().Error("User selected availalbe bike {bike} but reserving failed. {@exception}", SelectedBike, exception);
|
||||
Log.ForContext<DisposableClosed>().Error("User selected centered bike {bike} but reserving failed. {@exception}", SelectedBike, exception);
|
||||
|
||||
await ViewService.DisplayAlert(
|
||||
AppResources.MessageReservingBikeErrorGeneralTitle,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
using TINK.Model.Bikes.BikeInfoNS.CopriLock;
|
||||
|
@ -46,7 +46,7 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
/// <summary> Open bike and update COPRI lock state. </summary>
|
||||
public async Task<IRequestHandler> HandleRequestOption2() => await GiveFeedback();
|
||||
|
||||
/// <summary> Requst is not supported, button should be disabled. </summary>
|
||||
/// <summary> Request is not supported, button should be disabled. </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IRequestHandler> UnsupportedRequest()
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
|
||||
if (SelectedBike?.BookingFinishedModel?.MiniSurvey?.Questions?.Count > 0)
|
||||
{
|
||||
// No need to restrart polling again because different page is shown.
|
||||
// No need to restart polling again because different page is shown.
|
||||
await ViewService.PushModalAsync(ViewTypes.MiniSurvey);
|
||||
}
|
||||
|
||||
|
@ -121,4 +121,4 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
return RequestHandlerFactory.Create(SelectedBike, IsConnectedDelegate, ConnectorFactory, ViewUpdateManager, SmartDevice, ViewService, BikesViewModel, ActiveUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,11 +14,11 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
{
|
||||
using IRequestHandler = BluetoothLock.IRequestHandler;
|
||||
|
||||
/// <summary> Bike is reserved, lock is closed and and connected to app. </summary>
|
||||
/// <summary> Bike is reserved, lock is closed and connected to app. </summary>
|
||||
/// <remarks>
|
||||
/// Occures when
|
||||
/// - biks was reserved out of reach and is in reach now
|
||||
/// - bike is is reserved while in reach
|
||||
/// Occurs when
|
||||
/// - bike was reserved out of reach and is in reach now
|
||||
/// - bike is reserved while in reach
|
||||
/// </remarks>
|
||||
public class ReservedClosed : Base, IRequestHandler
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ namespace TINK.ViewModel.Bikes.Bike.CopriLock.RequestHandler
|
|||
{
|
||||
await ConnectorFactory(IsConnected).Command.DoCancelReservation(SelectedBike);
|
||||
|
||||
// If canceling bike succedes remove bike because it is not ready to be booked again
|
||||
// If canceling bike succeeds remove bike because it is not ready to be booked again
|
||||
IsRemoveBikeRequired = true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
|
|
@ -11,6 +11,8 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
{
|
||||
private const string TRACKINGKEY = "TRACKING";
|
||||
|
||||
private const string RIDETYPEKEY = "AAFAHRTEN";
|
||||
|
||||
public TariffDescriptionViewModel(RentalDescription tariff)
|
||||
{
|
||||
Name = tariff?.Name ?? string.Empty;
|
||||
|
@ -19,13 +21,17 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
? new ObservableCollection<RentalDescription.TariffElement>(tariff.TariffEntries.OrderBy(x => x.Key).Select(x => x.Value))
|
||||
: new ObservableCollection<RentalDescription.TariffElement>();
|
||||
|
||||
// Add all entires except the known entries which are kept as properties.
|
||||
InfoEntries = tariff != null && tariff?.InfoEntries != null
|
||||
? new ObservableCollection<string>(tariff.InfoEntries
|
||||
.Where(x => x.Value.Key.ToUpper() != TRACKINGKEY)
|
||||
.Where(x => x.Value.Key.ToUpper() != TRACKINGKEY
|
||||
&& x.Value.Key.ToUpper() != RIDETYPEKEY)
|
||||
.OrderBy(x => x.Key)
|
||||
.Select(x => x.Value.Value))
|
||||
: new ObservableCollection<string>();
|
||||
|
||||
RideTypeText = tariff?.InfoEntries != null ? tariff?.InfoEntries?.FirstOrDefault(x => x.Value.Key.ToUpper() == RIDETYPEKEY).Value?.Value ?? string.Empty : string.Empty;
|
||||
|
||||
TrackingInfoText = tariff?.InfoEntries != null ? tariff?.InfoEntries?.FirstOrDefault(x => x.Value.Key.ToUpper() == TRACKINGKEY).Value?.Value ?? string.Empty : string.Empty;
|
||||
}
|
||||
|
||||
|
@ -44,6 +50,11 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
/// </summary>
|
||||
public ObservableCollection<string> InfoEntries { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Holds the tracking info text or empty if not applicable.
|
||||
/// </summary>
|
||||
public string RideTypeText { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Holds the tracking info text or empty if not applicable.
|
||||
/// </summary>
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace TINK.ViewModel.Bikes
|
|||
/// <summary> Delegate to retrieve connected state. </summary>
|
||||
protected Func<bool> IsConnectedDelegate { get; }
|
||||
|
||||
/// <summary>Holds whether to poll or not and the periode leght is polling is on.</summary>
|
||||
/// <summary>Holds whether to poll or not and the period length is polling is on.</summary>
|
||||
private TINK.Settings.PollingParameters m_oPolling;
|
||||
|
||||
/// <summary> Object to manage update of view model objects from Copri.</summary>
|
||||
|
@ -61,7 +61,7 @@ namespace TINK.ViewModel.Bikes
|
|||
protected override void OnPropertyChanged(PropertyChangedEventArgs p_oEventArgs) => base.OnPropertyChanged(p_oEventArgs);
|
||||
|
||||
/// <summary>
|
||||
/// Handles events from bike viewmodel which require GUI updates.
|
||||
/// Handles events from bike view model which require GUI updates.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
|
@ -81,16 +81,16 @@ namespace TINK.ViewModel.Bikes
|
|||
/// </param>
|
||||
/// <param name="p_oUser">Mail address of active user.</param>
|
||||
/// <param name="isReportLevelVerbose">True if report level is verbose, false if not.</param>
|
||||
/// <param name="permissions">Holds object to query location permisions.</param>
|
||||
/// <param name="permissions">Holds object to query location permissions.</param>
|
||||
/// <param name="bluetoothLE">Holds object to query bluetooth state.</param>
|
||||
/// <param name="runtimPlatform">Specifies on which platform code is run.</param>
|
||||
/// <param name="isConnectedDelegate">Returns if mobile is connected to web or not.</param>
|
||||
/// <param name="connectorFactory">Connects system to copri for purposes of requesting a bike/ cancel request.</param>
|
||||
/// <param name="lockService">Service to control lock retrieve info.</param>
|
||||
/// <param name="p_oPolling"> Holds whether to poll or not and the periode leght is polling is on. </param>
|
||||
/// <param name="p_oPolling"> Holds whether to poll or not and the period length is polling is on. </param>
|
||||
/// <param name="postAction">Executes actions on GUI thread.</param>
|
||||
/// <param name="smartDevice">Provides info about the smart device (phone, tablet, ...)</param>
|
||||
/// <param name="viewService">Interface to actuate methodes on GUI.</param>
|
||||
/// <param name="viewService">Interface to actuate methods on GUI.</param>
|
||||
/// <param name="openUrlInBrowser">Delegate to open browser.</param>
|
||||
public BikesViewModel(
|
||||
User user,
|
||||
|
@ -156,7 +156,7 @@ namespace TINK.ViewModel.Bikes
|
|||
|
||||
CollectionChanged += (sender, eventargs) =>
|
||||
{
|
||||
// Notify about bikes occuring/ vanishing from list.
|
||||
// Notify about bikes occurring/ vanishing from list.
|
||||
OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsBikesListVisible)));
|
||||
};
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ namespace TINK.ViewModel.Bikes
|
|||
{
|
||||
case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
|
||||
|
||||
// New bike avaialbe (new arrived at station or bike wased booked on a different device)
|
||||
// New bike available (new arrived at station or bike was booked on a different device)
|
||||
foreach (var bike in BikeCollection)
|
||||
{
|
||||
if (Contains(bike.Id))
|
||||
|
@ -415,7 +415,7 @@ namespace TINK.ViewModel.Bikes
|
|||
/// <summary>
|
||||
/// Gets whether a bike is contained in collection of bikes.
|
||||
/// </summary>
|
||||
/// <param name="id">Id of bike to check existance.</param>
|
||||
/// <param name="id">Id of bike to check existence.</param>
|
||||
/// <returns>True if bike exists.</returns>
|
||||
private bool Contains(string id)
|
||||
{
|
||||
|
@ -448,14 +448,14 @@ namespace TINK.ViewModel.Bikes
|
|||
/// <summary>
|
||||
/// Invoked when page is shown and starts update process.
|
||||
/// </summary>
|
||||
/// <param name="updateAction"> Update fuction passed as argument by child class.</param>
|
||||
/// <param name="updateAction"> Update function passed as argument by child class.</param>
|
||||
protected async Task OnAppearing(Action updateAction)
|
||||
=> await StartUpdateTask(updateAction);
|
||||
|
||||
/// <summary>
|
||||
/// Starts update process.
|
||||
/// </summary>
|
||||
/// <param name="updateAction"> Update fuction passed as argument by child class.</param>
|
||||
/// <param name="updateAction"> Update function passed as argument by child class.</param>
|
||||
public async Task StartUpdateTask(Action updateAction)
|
||||
{
|
||||
m_oViewUpdateManager = new PollingUpdateTaskManager(updateAction);
|
||||
|
|
|
@ -12,7 +12,8 @@ using TINK.Model.Bikes;
|
|||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Model.Stations;
|
||||
using TINK.Model.Stations.StationNS;
|
||||
using TINK.Model.User;
|
||||
using TINK.MultilingualResources;
|
||||
using TINK.Services.BluetoothLock;
|
||||
|
@ -60,17 +61,17 @@ namespace TINK.ViewModel.BikesAtStation
|
|||
/// Constructs bike collection view model.
|
||||
/// </summary>
|
||||
/// <param name="user">Mail address of active user.</param>
|
||||
/// <param name="permissions">Holds object to query location permisions.</param>
|
||||
/// <param name="permissions">Holds object to query location permissions.</param>
|
||||
/// <param name="bluetoothLE">Holds object to query bluetooth state.</param>
|
||||
/// <param name="runtimPlatform">Specifies on which platform code is run.</param>
|
||||
/// <param name="isConnectedDelegate">Returns if mobile is connected to web or not.</param>
|
||||
/// <param name="connectorFactory">Connects system to copri.</param>
|
||||
/// <param name="lockService">Service to control lock retrieve info.</param>
|
||||
/// <param name="polling"> Holds whether to poll or not and the periode leght is polling is on. </param>
|
||||
/// <param name="polling"> Holds whether to poll or not and the period length is polling is on. </param>
|
||||
/// <param name="openUrlInExternalBrowser">Action to open an external browser.</param>
|
||||
/// <param name="postAction">Executes actions on GUI thread.</param>
|
||||
/// <param name="smartDevice">Provides info about the smart device (phone, tablet, ...).</param>
|
||||
/// <param name="viewService">Interface to actuate methodes on GUI.</param>
|
||||
/// <param name="viewService">Interface to actuate methods on GUI.</param>
|
||||
public BikesAtStationPageViewModel(
|
||||
User user,
|
||||
ILocationPermission permissions,
|
||||
|
@ -384,7 +385,7 @@ namespace TINK.ViewModel.BikesAtStation
|
|||
var exception = result.Exception;
|
||||
if (exception != null)
|
||||
{
|
||||
Log.ForContext<BikesAtStationPageViewModel>().Error("Getting all bikes bikes in polling context failed with exception {Exception}.", exception);
|
||||
Log.ForContext<BikesAtStationPageViewModel>().Error("Getting all bikes in polling context failed with exception {Exception}.", exception);
|
||||
}
|
||||
|
||||
PostAction(
|
||||
|
|
|
@ -5,7 +5,8 @@ using System.Threading.Tasks;
|
|||
using System.Windows.Input;
|
||||
using Plugin.Messaging;
|
||||
using Serilog;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Model.Stations;
|
||||
using TINK.Model.Stations.StationNS;
|
||||
using TINK.MultilingualResources;
|
||||
using TINK.View;
|
||||
using Xamarin.Essentials;
|
||||
|
@ -50,7 +51,7 @@ namespace TINK.ViewModel.Info
|
|||
{
|
||||
AppFlavorName = !string.IsNullOrEmpty(appFlavorName)
|
||||
? appFlavorName
|
||||
: throw new ArgumentException("Can not instantiate contact page view model- object. No app name availalbe.");
|
||||
: throw new ArgumentException("Can not instantiate contact page view model- object. No app name centered.");
|
||||
|
||||
CreateAttachment = createAttachment
|
||||
?? throw new ArgumentException("Can not instantiate contact page view model- object. No create attachment provider available.");
|
||||
|
@ -89,7 +90,7 @@ namespace TINK.ViewModel.Info
|
|||
async () => await DoSendMailToOperator(),
|
||||
() => IsSendMailAvailable);
|
||||
|
||||
/// <summary> Command object to bind mail app releated button to model. </summary>
|
||||
/// <summary> Command object to bind mail app related button to model. </summary>
|
||||
public ICommand OnMailAppRelatedRequest
|
||||
=> new Command(
|
||||
async () => await DoSendMailAppRelated(),
|
||||
|
@ -116,11 +117,11 @@ namespace TINK.ViewModel.Info
|
|||
public string OfficeHoursText
|
||||
=> SelectedStation?.OperatorData?.Hours ?? string.Empty;
|
||||
|
||||
/// <summary> Gets whether any operator support info is avaliable. </summary>
|
||||
/// <summary> Gets whether any operator support info is available. </summary>
|
||||
public bool IsOperatorInfoAvaliable
|
||||
=> MailAddressText.Length > 0 || PhoneNumberText.Length > 0;
|
||||
|
||||
/// <returns> Returns true if eithe mail was sent or if no mailer available.</returns>
|
||||
/// <returns> Returns true if either mail was sent or if no mailer available.</returns>
|
||||
public async Task DoSendMailToOperator()
|
||||
{
|
||||
try
|
||||
|
@ -149,12 +150,12 @@ namespace TINK.ViewModel.Info
|
|||
return;
|
||||
}
|
||||
|
||||
// Send app-related related support mail to operator.
|
||||
// Send app-related support mail to operator.
|
||||
await Email.ComposeAsync(new EmailMessage
|
||||
{
|
||||
To = new List<string> { MailAddressText },
|
||||
Cc = APPSUPPORTMAILADDRESS.ToUpper() != MailAddressText.ToUpper() // do not sent copy if same mail adress
|
||||
&& MailAddressText != "konrad@sharee.bike" // do not sent copy if Meinkonrad
|
||||
Cc = APPSUPPORTMAILADDRESS.ToUpper() != MailAddressText.ToUpper() // do not sent copy if same mail address
|
||||
&& MailAddressText != "konrad@sharee.bike" // do not sent copy if Mein konrad
|
||||
? new List<string> { APPSUPPORTMAILADDRESS } : new List<string>(),
|
||||
Subject = string.Format(AppResources.SupportmailSubjectAppmail, AppFlavorName)
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using Xamarin.Forms;
|
||||
using TINK.View;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Model.Stations;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using TINK.Model.Bikes;
|
||||
|
@ -27,7 +27,7 @@ namespace TINK.ViewModel.Contact
|
|||
{
|
||||
public class SelectStationPageViewModel : INotifyPropertyChanged
|
||||
{
|
||||
/// <summary> Holds the count of custom icons availalbe.</summary>
|
||||
/// <summary> Holds the count of custom icons centered.</summary>
|
||||
private const int CUSTOM_ICONS_COUNT = 30;
|
||||
|
||||
/// <summary> Reference on view service to show modal notifications and to perform navigation. </summary>
|
||||
|
@ -169,8 +169,8 @@ namespace TINK.ViewModel.Contact
|
|||
{
|
||||
if (station.Position == null)
|
||||
{
|
||||
// There should be no reason for a position object to be null but this alreay occurred in past.
|
||||
Log.ForContext<SelectStationPageViewModel>().Error("Postion object of station {@l_oStation} is null.", station);
|
||||
// There should be no reason for a position object to be null but this already occurred in past.
|
||||
Log.ForContext<SelectStationPageViewModel>().Error("Position object of station {@l_oStation} is null.", station);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -340,8 +340,8 @@ namespace TINK.ViewModel.Contact
|
|||
Pins.Clear();
|
||||
}
|
||||
|
||||
// Check if there are alreay any pins to the map
|
||||
// i.e detecte first call of member OnAppearing after construction
|
||||
// Check if there are already any pins to the map
|
||||
// i.e detects first call of member OnAppearing after construction
|
||||
if (Pins.Count <= 0)
|
||||
{
|
||||
// Map was not yet initialized.
|
||||
|
@ -457,7 +457,7 @@ namespace TINK.ViewModel.Contact
|
|||
IsMapPageEnabled = false;
|
||||
|
||||
TinkApp.SelectedStation = TinkApp.Stations.FirstOrDefault(x => x.Id == selectedStationId)
|
||||
?? new Station(selectedStationId, new List<string>(), null); // Station might not be in list StationDictinaly because this list is not updatd in background task.
|
||||
?? new Model.Stations.StationNS.Station(selectedStationId, new List<string>(), null); // Station might not be in list StationDictinaly because this list is not updated in background task.
|
||||
|
||||
#if TRYNOTBACKSTYLE
|
||||
m_oNavigation.ShowPage(
|
||||
|
@ -504,7 +504,7 @@ namespace TINK.ViewModel.Contact
|
|||
|
||||
if (bikesAll == null)
|
||||
{
|
||||
// If object is null an error occurred querrying bikes availalbe or bikes occpied which results in an unknown state.
|
||||
// If object is null an error occurred querying bikes centered or bikes occupied which results in an unknown state.
|
||||
Log.ForContext<SelectStationPageViewModel>().Error("No bikes available to determine pins color.");
|
||||
return new List<Color>(stationsId.Select(x => Color.Blue));
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace TINK.ViewModel.Contact
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Object to querry resources urls object from backend if required.
|
||||
/// Object to query resources urls object from backend if required.
|
||||
/// This object is used to update resources path values <see cref="FeesResourcePath"/>, and <see cref="BikesResourcePath"/> from.
|
||||
/// </summary>
|
||||
private Func<IQuery> QueryProvider { get; }
|
||||
|
@ -65,7 +65,7 @@ namespace TINK.ViewModel.Contact
|
|||
/// <summary> Constructs view model.</summary>
|
||||
/// <param name="isSiteCachingOn">Set of user permissions</param>
|
||||
/// <param name="resourceProvider">Delegate to get an an embedded html ressource. Used as fallback if download from web page does not work and cache is empty.</param>
|
||||
/// <param name="query">Object to querry resources path values if required.</param>
|
||||
/// <param name="query">Object to query resources path values if required.</param>
|
||||
public FeesAndBikesPageViewModel(
|
||||
string hostName,
|
||||
string feesResourcePath,
|
||||
|
|
|
@ -14,7 +14,7 @@ using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
|||
using TINK.Model.Connector;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.Services.CopriApi;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Model.Stations.StationNS;
|
||||
using TINK.Model.User;
|
||||
using TINK.MultilingualResources;
|
||||
using TINK.Repository.Exception;
|
||||
|
@ -105,17 +105,17 @@ namespace TINK.ViewModel.FindBike
|
|||
/// </summary>
|
||||
/// <param name="p_oUser">Mail address of active user.</param>
|
||||
/// <param name="isReportLevelVerbose">True if report level is verbose, false if not.</param>
|
||||
/// <param name="permissions">Holds object to query location permisions.</param>
|
||||
/// <param name="permissions">Holds object to query location permissions.</param>
|
||||
/// <param name="bluetoothLE">Holds object to query bluetooth state.</param>
|
||||
/// <param name="runtimPlatform">Specifies on which platform code is run.</param>
|
||||
/// <param name="isConnectedDelegate">Returns if mobile is connected to web or not.</param>
|
||||
/// <param name="connectorFactory">Connects system to copri.</param>
|
||||
/// <param name="lockService">Service to control lock retrieve info.</param>
|
||||
/// <param name="stations">Stations to get station name from station id.</param>
|
||||
/// <param name="polling"> Holds whether to poll or not and the periode leght is polling is on. </param>
|
||||
/// <param name="polling"> Holds whether to poll or not and the period length is polling is on. </param>
|
||||
/// <param name="postAction">Executes actions on GUI thread.</param>
|
||||
/// <param name="smartDevice">Provides info about the smart device (phone, tablet, ...).</param>
|
||||
/// <param name="viewService">Interface to actuate methodes on GUI.</param>
|
||||
/// <param name="viewService">Interface to actuate methods on GUI.</param>
|
||||
/// <param name="openUrlInBrowser">Delegate to open browser.</param>
|
||||
public FindBikePageViewModel(
|
||||
User p_oUser,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TINK.View;
|
||||
using Xamarin.Forms;
|
||||
|
@ -13,7 +13,7 @@ namespace TINK.ViewModel.Info.BikeInfo
|
|||
private readonly IViewService m_oViewService;
|
||||
|
||||
|
||||
/// <param name="p_oViewService">Interface to actuate methodes on GUI.</param>
|
||||
/// <param name="p_oViewService">Interface to actuate methods on GUI.</param>
|
||||
public BikeInfoViewModel(Func<string, ImageSource> imageSourceFunc, IViewService p_oViewService)
|
||||
{
|
||||
m_oViewService = p_oViewService
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace TINK.ViewModel.Info
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Object to querry resources urls object from backend if required.
|
||||
/// Object to query resources urls object from backend if required.
|
||||
/// This object is used to update resources path values <see cref="AgbResourcePath"/>, <see cref="PrivacyResourcePath"/> and <see cref="ImpressResourcePath"/> from.
|
||||
/// </summary>
|
||||
private Func<IQuery> QueryProvider { get; }
|
||||
|
@ -79,7 +79,7 @@ namespace TINK.ViewModel.Info
|
|||
/// <param name="privacyResourcePath"> Privacy resouce path received from backend.</param>
|
||||
/// <param name="impressResourcePath"> Impress resouce path received from backend.</param>
|
||||
/// <param name="resourceProvider">Delegate to get an an embedded html ressource. Used as fallback if download from web page does not work and cache is empty.</param>
|
||||
/// <param name="queryProvider">Object to querry resources urls object from backend if required.</param>
|
||||
/// <param name="queryProvider">Object to query resources urls object from backend if required.</param>
|
||||
/// <param name="updateUrlsAction">Action to update shared resources urls object</param>
|
||||
public InfoPageViewModel(
|
||||
string hostName,
|
||||
|
@ -102,7 +102,7 @@ namespace TINK.ViewModel.Info
|
|||
InfoAgb = new HtmlWebViewSource { Html = "<html>Loading...</html>" };
|
||||
|
||||
ResourceProvider = resourceProvider
|
||||
?? throw new ArgumentException($"Can not instantiate {typeof(InfoPageViewModel)}-object. No ressource provider availalbe.");
|
||||
?? throw new ArgumentException($"Can not instantiate {typeof(InfoPageViewModel)}-object. No ressource provider centered.");
|
||||
}
|
||||
|
||||
/// <summary> Called when page is shown. </summary>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
@ -57,7 +57,7 @@ namespace TINK.ViewModel
|
|||
/// <param name="p_oSetCredentials">Delegate to set new mail address and password to model.</param>
|
||||
/// <param name="p_oUser">Mail address of user if login succeeded.</param>
|
||||
/// <param name="openUrlInExternalBrowser">Action to open an external browser.</param>
|
||||
/// <param name="p_oViewService">Interface to actuate methodes on GUI.</param>
|
||||
/// <param name="p_oViewService">Interface to actuate methods on GUI.</param>
|
||||
/// <param name="p_oNavigation">Interface to navigate.</param>
|
||||
public LoginPageViewModel(
|
||||
ITinkApp tinkApp,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using Xamarin.Forms;
|
||||
using TINK.View;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Model.Stations;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using TINK.Model.Bikes;
|
||||
|
@ -39,7 +39,7 @@ namespace TINK.ViewModel.Map
|
|||
private static bool WasMerchantMessageAlreadyShown { get; set; } = false;
|
||||
|
||||
|
||||
/// <summary> Holds the count of custom icons availalbe.</summary>
|
||||
/// <summary> Holds the count of custom icons centered.</summary>
|
||||
private const int CUSTOM_ICONS_COUNT = 30;
|
||||
|
||||
/// <summary> Reference on view service to show modal notifications and to perform navigation. </summary>
|
||||
|
@ -67,7 +67,7 @@ namespace TINK.ViewModel.Map
|
|||
/// <summary> Object to manage update of view model objects from Copri.</summary>
|
||||
private IPollingUpdateTaskManager m_oViewUpdateManager;
|
||||
|
||||
/// <summary>Holds whether to poll or not and the periode leght is polling is on.</summary>
|
||||
/// <summary>Holds whether to poll or not and the period length is polling is on.</summary>
|
||||
private PollingParameters Polling { get; set; }
|
||||
|
||||
/// <summary> Reference on the tink app instance. </summary>
|
||||
|
@ -228,8 +228,8 @@ namespace TINK.ViewModel.Map
|
|||
{
|
||||
if (station.Position == null)
|
||||
{
|
||||
// There should be no reason for a position object to be null but this alreay occurred in past.
|
||||
Log.ForContext<MapPageViewModel>().Error("Postion object of station {@l_oStation} is null.", station);
|
||||
// There should be no reason for a position object to be null but this already occurred in past.
|
||||
Log.ForContext<MapPageViewModel>().Error("Position object of station {@l_oStation} is null.", station);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -355,7 +355,7 @@ namespace TINK.ViewModel.Map
|
|||
Polling = TinkApp.Polling;
|
||||
|
||||
Log.ForContext<MapPageViewModel>().Information(
|
||||
$"{(Polling != null && Polling.IsActivated ? $"Map page is appearing. Update periode is {Polling.Periode.TotalSeconds} sec." : "Map page is appearing. Polling is off.")}" +
|
||||
$"{(Polling != null && Polling.IsActivated ? $"Map page is appearing. Update period is {Polling.Periode.TotalSeconds} sec." : "Map page is appearing. Polling is off.")}" +
|
||||
$"Current UI language is {Thread.CurrentThread.CurrentUICulture.Name}.");
|
||||
|
||||
// Update map page filter
|
||||
|
@ -516,13 +516,13 @@ namespace TINK.ViewModel.Map
|
|||
if (Pins.Count > 0 && Pins.Count != stations.Count)
|
||||
{
|
||||
// Either
|
||||
// - user logged in/ logged out which might lead to more/ less stations beeing available
|
||||
// - user logged in/ logged out which might lead to more/ less stations being available
|
||||
// - new stations were added/ existing ones remove
|
||||
Pins.Clear();
|
||||
}
|
||||
|
||||
// Check if there are alreay any pins to the map
|
||||
// i.e detecte first call of member OnAppearing after construction
|
||||
// Check if there are already any pins to the map
|
||||
// i.e detects first call of member OnAppearing after construction
|
||||
if (Pins.Count <= 0)
|
||||
{
|
||||
Log.ForContext<MapPageViewModel>().Debug($"{(ActiveFilterMap.GetGroup().Any() ? $"Active map filter is {string.Join(",", ActiveFilterMap.GetGroup())}." : "Map filter is off.")}");
|
||||
|
@ -657,8 +657,8 @@ namespace TINK.ViewModel.Map
|
|||
// Load MyBikes Count -> MyBikes Icon/Button
|
||||
GetMyBikesCount(resultStationsAndBikes.Response.Bikes);
|
||||
|
||||
// Check if there are alreay any pins to the map.
|
||||
// If no initialze pins.
|
||||
// Check if there are already any pins to the map.
|
||||
// If no initialize pins.
|
||||
if (Pins.Count <= 0)
|
||||
{
|
||||
// Set pins to their positions on map.
|
||||
|
@ -725,7 +725,7 @@ namespace TINK.ViewModel.Map
|
|||
IsMapPageEnabled = false;
|
||||
|
||||
TinkApp.SelectedStation = TinkApp.Stations.FirstOrDefault(x => x.Id == selectedStationId)
|
||||
?? new Station(selectedStationId, new List<string>(), null); // Station might not be in list StationDictinaly because this list is not updatd in background task.
|
||||
?? new Model.Stations.StationNS.Station(selectedStationId, new List<string>(), null); // Station might not be in list StationDictinaly because this list is not updated in background task.
|
||||
|
||||
#if TRYNOTBACKSTYLE
|
||||
m_oNavigation.ShowPage(
|
||||
|
@ -771,7 +771,7 @@ namespace TINK.ViewModel.Map
|
|||
|
||||
if (bikesAll == null)
|
||||
{
|
||||
// If object is null an error occurred querrying bikes availalbe or bikes occpied which results in an unknown state.
|
||||
// If object is null an error occurred querying bikes centered or bikes occupied which results in an unknown state.
|
||||
Log.ForContext<MapPageViewModel>().Error("No bikes available to determine pins color.");
|
||||
return new List<Color>(stationsId.Select(x => Color.Blue));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
|
@ -29,7 +29,7 @@ namespace TINK.ViewModel.MiniSurvey
|
|||
|
||||
/// <summary> Constructs mini survey view model.</summary>
|
||||
/// <param name="connectorFactory">Connects system to copri for purposes of requesting a bike/ cancel request.</param>
|
||||
/// <param name="viewService">Interface to actuate methodes on GUI.</param>
|
||||
/// <param name="viewService">Interface to actuate methods on GUI.</param>
|
||||
public MiniSurveyViewModel(
|
||||
Func<bool> isConnectedDelegate,
|
||||
Func<bool, IConnector> connectorFactory,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using TINK.Model.State;
|
||||
using TINK.MultilingualResources;
|
||||
using TINK.ViewModel.Bikes.Bike;
|
||||
|
@ -23,7 +23,7 @@ namespace TINK.ViewModel
|
|||
|
||||
if (string.IsNullOrEmpty(code))
|
||||
{
|
||||
// Code is not avilable
|
||||
// Code is not available
|
||||
return string.Format(AppResources.StatusTextReservationExpiredMaximumReservationTime, StateRequestedInfo.MaximumReserveTime.Minutes);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ using TINK.Model.Bikes;
|
|||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Model.Stations.StationNS;
|
||||
using TINK.Model.User;
|
||||
using TINK.MultilingualResources;
|
||||
using TINK.Services.BluetoothLock;
|
||||
|
@ -57,17 +57,17 @@ namespace TINK.ViewModel.MyBikes
|
|||
/// </summary>
|
||||
/// <param name="p_oUser">Mail address of active user.</param>
|
||||
/// <param name="isReportLevelVerbose">True if report level is verbose, false if not.</param>
|
||||
/// <param name="permissions">Holds object to query location permisions.</param>
|
||||
/// <param name="permissions">Holds object to query location permissions.</param>
|
||||
/// <param name="bluetoothLE">Holds object to query bluetooth state.</param>
|
||||
/// <param name="runtimPlatform">Specifies on which platform code is run.</param>
|
||||
/// <param name="isConnectedDelegate">Returns if mobile is connected to web or not.</param>
|
||||
/// <param name="connectorFactory">Connects system to copri.</param>
|
||||
/// <param name="lockService">Service to control lock retrieve info.</param>
|
||||
/// <param name="stations">Stations to get station name from station id.</param>
|
||||
/// <param name="p_oPolling"> Holds whether to poll or not and the periode leght is polling is on. </param>
|
||||
/// <param name="p_oPolling"> Holds whether to poll or not and the period length is polling is on. </param>
|
||||
/// <param name="postAction">Executes actions on GUI thread.</param>
|
||||
/// <param name="smartDevice">Provides info about the smart device (phone, tablet, ...).</param>
|
||||
/// <param name="viewService">Interface to actuate methodes on GUI.</param>
|
||||
/// <param name="viewService">Interface to actuate methods on GUI.</param>
|
||||
/// <param name="openUrlInBrowser">Delegate to open browser.</param>
|
||||
public MyBikesPageViewModel(
|
||||
User p_oUser,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -23,7 +23,7 @@ namespace TINK.ViewModel
|
|||
|
||||
/// <summary> Obects which does a periodic update. </summary>
|
||||
/// <param name="updateAction">Update action to perform.</param>
|
||||
/// <param name="polling"> Holds whether to poll or not and the periode leght is polling is on. </param>
|
||||
/// <param name="polling"> Holds whether to poll or not and the period length is polling is on. </param>
|
||||
public PollingUpdateTask(
|
||||
Action updateAction,
|
||||
TimeSpan? polling)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
using TINK.Settings;
|
||||
|
@ -39,7 +39,7 @@ namespace TINK.ViewModel
|
|||
/// Invoked when page is shown.
|
||||
/// Actuates and awaits the first update process and starts a task wich actuate the subseqent update tasks.
|
||||
/// </summary>
|
||||
/// <param name="pollingParameters">Parametes holding polling periode, if null last parameters are used if available.</param>
|
||||
/// <param name="pollingParameters">Parametes holding polling period, if null last parameters are used if available.</param>
|
||||
public async Task StartUpdateAyncPeridically(PollingParameters pollingParameters = null)
|
||||
{
|
||||
if (UpdateTask != null)
|
||||
|
|
|
@ -3,7 +3,7 @@ using TINK.Model;
|
|||
|
||||
namespace TINK.ViewModel.Settings
|
||||
{
|
||||
/// <summary>Holds filter item incluting full state (avaialble, activated, name, ...). </summary>
|
||||
/// <summary>Holds filter item including full state (available, activated, name, ...). </summary>
|
||||
public class FilterItemMutable : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
@ -32,7 +32,7 @@ namespace TINK.ViewModel.Settings
|
|||
/// <summary> Text describing the filter. </summary>
|
||||
public string Text { get; }
|
||||
|
||||
/// <summary> True if switch can be toggeled.</summary>
|
||||
/// <summary> True if switch can be toggled.</summary>
|
||||
public bool IsEnabled { get; }
|
||||
|
||||
/// <summary> True if switch is on.</summary>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using TINK.Settings;
|
||||
|
||||
|
@ -10,7 +10,7 @@ namespace TINK.ViewModel.Settings
|
|||
/// <summary>Holds the views polling parameters.</summary>
|
||||
private PollingParameters m_oPolling = PollingParameters.Default;
|
||||
|
||||
/// <summary> Current polling periode. Used to check whether values were modified or not.</summary>
|
||||
/// <summary> Current polling period. Used to check whether values were modified or not.</summary>
|
||||
private readonly PollingParameters m_oPollingActive;
|
||||
|
||||
/// <summary> Constructs polling object. </summary>
|
||||
|
@ -52,7 +52,7 @@ namespace TINK.ViewModel.Settings
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary> Gests or sets the polling periode [sec]. </summary>
|
||||
/// <summary> Gests or sets the polling period [sec]. </summary>
|
||||
public int PeriodeTotalSeconds
|
||||
{
|
||||
get
|
||||
|
@ -76,7 +76,7 @@ namespace TINK.ViewModel.Settings
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets info about polling periode.</summary>
|
||||
/// <summary> Gets info about polling period.</summary>
|
||||
public string PeriodeTotalSecondsText
|
||||
{
|
||||
get
|
||||
|
|
|
@ -356,7 +356,7 @@ namespace TINK.ViewModel
|
|||
/// <summary> Empty if no user is logged in session cookie otherwise. </summary>
|
||||
public string SessionCookie => TinkApp.ActiveUser.IsLoggedIn ? TinkApp.ActiveUser.SessionCookie : "";
|
||||
|
||||
/// <summary>Polling periode.</summary>
|
||||
/// <summary>Polling period.</summary>
|
||||
public PollingViewModel Polling { get; }
|
||||
|
||||
/// <summary> Active logging level</summary>
|
||||
|
|
|
@ -7,7 +7,7 @@ using Serilog;
|
|||
using TINK.Model.Bikes.BikeInfoNS.BC;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.State;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Model.Stations.StationNS;
|
||||
using TINK.Model.User;
|
||||
using TINK.MultilingualResources;
|
||||
using TINK.Repository;
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace TINK.ViewModel.WhatsNew.Agb
|
|||
?? throw new ArgumentException($"Can not instantiate {typeof(WhatsNewViewModel)}-object. No view available.");
|
||||
|
||||
ResourceProvider = resourceProvider
|
||||
?? throw new ArgumentException($"Can not instantiate {typeof(WhatsNewViewModel)}-object. No ressource provider availalbe.");
|
||||
?? throw new ArgumentException($"Can not instantiate {typeof(WhatsNewViewModel)}-object. No ressource provider centered.");
|
||||
}
|
||||
|
||||
/// <summary> Gets the platfrom specific prefix. </summary>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Input;
|
||||
|
@ -26,7 +26,7 @@ namespace TINK.ViewModel.WhatsNew
|
|||
?? throw new ArgumentException($"Can not instantiate {typeof(WhatsNewViewModel)}-object. No view available.");
|
||||
|
||||
ShowMasterDetail = showMasterDetail
|
||||
?? throw new ArgumentException($"Can not instantiate {typeof(WhatsNewViewModel)}-object. No delegate to activated maste detail page avilable.");
|
||||
?? throw new ArgumentException($"Can not instantiate {typeof(WhatsNewViewModel)}-object. No delegate to activated maste detail page available.");
|
||||
|
||||
CurrentVersion = currentVersion;
|
||||
WhatsNewText = new FormattedString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue