Code updated to 3.0.238

This commit is contained in:
Oliver Hauff 2021-06-26 20:57:55 +02:00
parent 3302d80678
commit 9c6a1fa92b
257 changed files with 7763 additions and 2861 deletions

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using TINK.Model.User.Account;
namespace TINK.Model.User
@ -29,14 +30,14 @@ namespace TINK.Model.User
/// </summary>
/// <param name="p_oAccountStore"> Object to use for loading and saving user data.</param>
public User(
IStore p_oAccountStore,
IAccount p_oAccount,
string p_strDeviceId)
IStore accountStore,
IAccount account,
string deviceId)
{
m_oStore = p_oAccountStore
m_oStore = accountStore
?? throw new ArgumentException("Can not instantiate user- object. No store functionality available.");
DeviceId = p_strDeviceId;
m_oAccount = new AccountMutable(p_oAccount);
DeviceId = deviceId;
m_oAccount = new AccountMutable(account);
}
/// <summary> Is fired wheneverlogin state changes. </summary>
@ -109,13 +110,13 @@ namespace TINK.Model.User
/// <param name="p_oAccount">Account to use for login.</param>
/// <param name="p_str_DeviceId">Holds the Id to identify the device.</param>
/// <param name="isConnected">True if connector has access to copri server, false if cached values are used.</param>
public void Login(IAccount account)
public async Task Login(IAccount account)
{
// Update account instance from copri data.
m_oAccount.Copy(account);
// Save data to store.
m_oStore.Save(m_oAccount);
await m_oStore.Save(m_oAccount);
// Nothing to do because state did not change.
StateChanged?.Invoke(this, new EventArgs());