using System.Threading.Tasks;
using Wabbajack.Common;
using Wabbajack.Interventions;
namespace Wabbajack
{
///
/// This should probably be replaced with an error, but this is just to get messageboxes out of the .Lib library
///
public class CriticalFailureIntervention : AErrorMessage
{
private TaskCompletionSource _source = new TaskCompletionSource();
public Task Task => _source.Task;
public CriticalFailureIntervention(string description, string title, bool exit = false)
{
ExtendedDescription = description;
ShortDescription = title;
ExitApplication = exit;
}
public override string ShortDescription { get; }
public override string ExtendedDescription { get; }
public bool ExitApplication { get; }
public void Cancel()
{
_source.SetResult(ConfirmationIntervention.Choice.Abort);
}
}
}