Pass account info to login dialogs
This commit is contained in:
parent
a12391f0ab
commit
d24c10ddf5
5 changed files with 18 additions and 8 deletions
|
|
@ -31,7 +31,7 @@ namespace LibationWinForms.Dialogs
|
|||
|
||||
try
|
||||
{
|
||||
(TotalBooksProcessed, NewBooksAdded) = await LibraryCommands.ImportAccountAsync(new WinformResponder(), _accounts);
|
||||
(TotalBooksProcessed, NewBooksAdded) = await LibraryCommands.ImportAccountAsync((account) => new WinformResponder(account), _accounts);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,19 @@
|
|||
using System;
|
||||
using AudibleApi;
|
||||
using InternalUtilities;
|
||||
using LibationWinForms.Dialogs.Login;
|
||||
|
||||
namespace LibationWinForms.Login
|
||||
{
|
||||
public class WinformResponder : AudibleApi.ILoginCallback
|
||||
public class WinformResponder : ILoginCallback
|
||||
{
|
||||
private Account _account { get; }
|
||||
|
||||
public WinformResponder(Account account)
|
||||
{
|
||||
_account = Dinah.Core.ArgumentValidator.EnsureNotNull(account, nameof(account));
|
||||
}
|
||||
|
||||
public string Get2faCode()
|
||||
{
|
||||
using var dialog = new _2faCodeDialog();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue