Version 3.0.337

This commit is contained in:
Anja Müller-Meißner 2022-08-30 15:42:25 +02:00
parent fd0e63cf10
commit 573fe77e12
2336 changed files with 33688 additions and 86082 deletions

View file

@ -1,11 +1,10 @@
using TINK.View;
using System.Windows.Input;
using Xamarin.Forms;
using System;
using System;
using System.ComponentModel;
using System.Threading.Tasks;
using System.Windows.Input;
using TINK.View;
using TINK.ViewModel.Info;
using TINK.Model.User.Account;
using Xamarin.Forms;
namespace TINK.ViewModel.WhatsNew.Agb
{
@ -20,21 +19,28 @@ namespace TINK.ViewModel.WhatsNew.Agb
/// <summary> Holds value wether site caching is on or off.</summary>
bool IsSiteCachingOn { get; }
/// <summary>
/// Holds the current ui two letter ISO language name.
/// </summary>
private string UiIsoLanguageName { get; }
/// <summary> Constructs AGB view model</summary>
/// <param name="isSiteCachingOn">Holds value wether site caching is on or off.</param>
/// <param name="uiIsoLangugageName">Two letter ISO language name.</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="p_oViewService">View service to close page.</param>
/// <param name="viewService">View service to close page.</param>
public AgbViewModel(
string hostName,
bool isSiteCachingOn,
string uiIsoLangugageName,
Func<string, string> resourceProvider,
IViewService p_oViewService)
IViewService viewService)
{
HostName = hostName;
IsSiteCachingOn = isSiteCachingOn;
UiIsoLanguageName = uiIsoLangugageName;
ViewService = p_oViewService
ViewService = viewService
?? throw new ArgumentException($"Can not instantiate {typeof(WhatsNewViewModel)}-object. No view available.");
ResourceProvider = resourceProvider
@ -61,7 +67,7 @@ namespace TINK.ViewModel.WhatsNew.Agb
/// <summary> Called when page is shown. </summary>
public async Task OnAppearing()
{
InfoAgb = await InfoPageViewModel.GetAgb(HostName, "agbResourcePath", IsSiteCachingOn);
InfoAgb = await InfoPageViewModel.GetAgb(HostName, "agbResourcePath", IsSiteCachingOn, UiIsoLanguageName);
}
/// <summary> User clicks OK button.</summary>

View file

@ -1,8 +1,9 @@
using TINK.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
using TINK.View;
using Xamarin.Forms;
using System;
using System.ComponentModel;
namespace TINK.ViewModel.WhatsNew
{
@ -16,7 +17,7 @@ namespace TINK.ViewModel.WhatsNew
/// <param name="p_oViewService">View service to show agb- page.</param>
public WhatsNewViewModel(
Version currentVersion,
string whatsNewText,
IDictionary<Version, string> whatsNewText,
bool isShowAgbRequired,
Action showMasterDetail,
IViewService p_oViewService)
@ -29,13 +30,13 @@ namespace TINK.ViewModel.WhatsNew
CurrentVersion = currentVersion;
WhatsNewText = new FormattedString();
WhatsNewText.Spans.Add(new Span { Text = whatsNewText });
WhatsNewText.Spans.Add(new Span { Text = GetWhatNextHtmlText(whatsNewText) });
IsAgbChangedVisible = isShowAgbRequired;
}
public Version CurrentVersion { get; }
public FormattedString WhatsNewText {get;}
public FormattedString WhatsNewText { get; }
/// <summary>
/// Title of the WhatsNewPage.
@ -57,7 +58,7 @@ namespace TINK.ViewModel.WhatsNew
var l_oHint = new FormattedString();
l_oHint.Spans.Add(new Span { Text = "AGBs ", ForegroundColor = ViewModelHelper.LINK_COLOR });
l_oHint.Spans.Add(new Span { Text = "überarbeitet.\r\n" });
return l_oHint;
}
}
@ -99,5 +100,8 @@ namespace TINK.ViewModel.WhatsNew
/// <summary>Reference to view service object.</summary>
private Action ShowMasterDetail { get; }
public static string GetWhatNextHtmlText(IDictionary<Version, string> whatsNew)
=> string.Join("", whatsNew.Select(element => $"<p><b>{element.Key}</b><br/>{element.Value}</p>").ToArray());
}
}