mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-21 12:36:28 +02:00
Version 3.0.342
This commit is contained in:
parent
d852ccef4c
commit
2cde196f16
54 changed files with 998 additions and 498 deletions
|
@ -1,4 +1,4 @@
|
|||
using Serilog;
|
||||
using Serilog;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Text.RegularExpressions;
|
||||
|
@ -355,32 +355,6 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
/// <summary> Gets the value of property <see cref="StateColor"/> when PropertyChanged was fired. </summary>
|
||||
public Color LastStateColor { get; set; }
|
||||
|
||||
/// <summary> Command object to bind login page redirect link to view model.</summary>
|
||||
public System.Windows.Input.ICommand ShowAgbTappedCommand
|
||||
=> new Xamarin.Forms.Command(() => ShowAgbPageAsync());
|
||||
|
||||
/// <summary> Opens login page. </summary>
|
||||
public void ShowAgbPageAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
var url = GetUrlFirstOrDefault(TariffDescription.OperatorAgb);
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
// No url contained in string.
|
||||
return;
|
||||
}
|
||||
|
||||
OpenUrlInBrowser(url);
|
||||
|
||||
}
|
||||
catch (Exception p_oException)
|
||||
{
|
||||
Log.Error("An unexpected error occurred opening broser. {@Exception}", p_oException);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets first url from text.</summary>
|
||||
/// <param name="htmlSource">url to extract text from.</param>
|
||||
/// <returns>Gets first url or an empty string if on url is contained in text.</returns>
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
IUser activeUser) : base(
|
||||
selectedBike,
|
||||
AppResources.ActionReturn, // Copri button text "Miete beenden"
|
||||
false, // Do no more allow to return bike.
|
||||
true, // Show button to enabled returning of bike.
|
||||
isConnectedDelegate,
|
||||
connectorFactory,
|
||||
geolocation,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.ObjectModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using TINK.Model.Bikes.BikeInfoNS;
|
||||
|
||||
|
@ -9,8 +9,6 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
/// </summary>
|
||||
public class TariffDescriptionViewModel
|
||||
{
|
||||
private const string AGBKEY = "AGB";
|
||||
|
||||
public TariffDescriptionViewModel(RentalDescription tariff)
|
||||
{
|
||||
Name = tariff?.Name ?? string.Empty;
|
||||
|
@ -20,13 +18,8 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
: new ObservableCollection<RentalDescription.TariffElement>();
|
||||
|
||||
InfoEntries = tariff != null && tariff?.InfoEntries != null
|
||||
? new ObservableCollection<string>(tariff.InfoEntries.OrderBy(x => x.Key).Where(x => x.Value.Key != AGBKEY).Select(x => x.Value.Value))
|
||||
? new ObservableCollection<string>(tariff.InfoEntries.OrderBy(x => x.Key).Select(x => x.Value.Value))
|
||||
: new ObservableCollection<string>();
|
||||
|
||||
OperatorAgb = tariff?.InfoEntries != null
|
||||
&& tariff.InfoEntries.Select(x => x.Value.Key).Contains(AGBKEY)
|
||||
? tariff?.InfoEntries.FirstOrDefault(x => x.Value.Key == AGBKEY).Value.Value
|
||||
: string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -44,9 +37,6 @@ namespace TINK.ViewModel.Bikes.Bike
|
|||
/// </summary>
|
||||
public ObservableCollection<string> InfoEntries { get; private set; }
|
||||
|
||||
/// <summary> Info about operator agb as HTML (i.g. text and hyperlink). </summary>
|
||||
public string OperatorAgb { get; set; }
|
||||
|
||||
public RentalDescription.TariffElement TarifEntry1 => TariffEntries.Count > 0 ? TariffEntries[0] : new RentalDescription.TariffElement();
|
||||
public RentalDescription.TariffElement TarifEntry2 => TariffEntries.Count > 1 ? TariffEntries[1] : new RentalDescription.TariffElement();
|
||||
public RentalDescription.TariffElement TarifEntry3 => TariffEntries.Count > 2 ? TariffEntries[2] : new RentalDescription.TariffElement();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue