2019-12-07 00:13:16 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2019-12-09 00:19:36 +00:00
|
|
|
|
using Wabbajack.Common;
|
2019-12-07 00:13:16 +00:00
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Lib.NexusApi
|
|
|
|
|
{
|
2019-12-09 00:19:36 +00:00
|
|
|
|
public class RequestNexusAuthorization : AUserIntervention
|
2019-12-07 00:13:16 +00:00
|
|
|
|
{
|
|
|
|
|
public override string ShortDescription => "Getting User's Nexus API Key";
|
|
|
|
|
public override string ExtendedDescription { get; }
|
|
|
|
|
|
|
|
|
|
private readonly TaskCompletionSource<string> _source = new TaskCompletionSource<string>();
|
|
|
|
|
public Task<string> Task => _source.Task;
|
|
|
|
|
|
|
|
|
|
public void Resume(string apikey)
|
|
|
|
|
{
|
2019-12-09 00:19:36 +00:00
|
|
|
|
Handled = true;
|
2019-12-07 00:13:16 +00:00
|
|
|
|
_source.SetResult(apikey);
|
|
|
|
|
}
|
2019-12-09 00:19:36 +00:00
|
|
|
|
|
|
|
|
|
public override void Cancel()
|
2019-12-07 00:13:16 +00:00
|
|
|
|
{
|
2019-12-09 00:19:36 +00:00
|
|
|
|
Handled = true;
|
2019-12-07 00:13:16 +00:00
|
|
|
|
_source.SetCanceled();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|