2022-01-03 22:46:28 +00:00
|
|
|
using System;
|
|
|
|
using System.Threading;
|
|
|
|
|
2022-01-01 22:55:39 +00:00
|
|
|
namespace Wabbajack.DTOs.Interventions;
|
|
|
|
|
2022-01-08 17:39:23 +00:00
|
|
|
|
|
|
|
public interface IUserIntervention
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2022-01-01 22:55:39 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Defines a message that requires user interaction. The user must perform some action
|
|
|
|
/// or make a choice.
|
|
|
|
/// </summary>
|
2022-01-08 17:39:23 +00:00
|
|
|
public interface IUserIntervention<TRet> : IUserIntervention
|
2022-01-01 22:55:39 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The user didn't make a choice, so this action should be aborted
|
|
|
|
/// </summary>
|
|
|
|
void Cancel();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Whether the interaction has been handled and no longer needs attention
|
|
|
|
/// </summary>
|
|
|
|
bool Handled { get; }
|
2022-01-03 22:46:28 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Token that can be used to trigger cancellation when Cancel() is called.
|
|
|
|
/// </summary>
|
|
|
|
public CancellationToken Token { get; }
|
|
|
|
|
|
|
|
void SetException(Exception exception);
|
2022-01-01 22:55:39 +00:00
|
|
|
}
|