wabbajack/Wabbajack.DTOs/Interventions/IUserIntervention.cs

29 lines
741 B
C#
Raw Permalink Normal View History

using System;
using System.Threading;
namespace Wabbajack.DTOs.Interventions;
/// <summary>
/// Defines a message that requires user interaction. The user must perform some action
/// or make a choice.
/// </summary>
2022-01-09 06:41:57 +00:00
public interface IUserIntervention
{
/// <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; }
/// <summary>
/// Token that can be used to trigger cancellation when Cancel() is called.
/// </summary>
public CancellationToken Token { get; }
void SetException(Exception exception);
2022-01-09 06:41:57 +00:00
}