mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-11 07:15:31 +03:00
33 lines
650 B
C#
33 lines
650 B
C#
|
using System.Threading;
|
|||
|
|
|||
|
namespace NAPS2.Operation;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// A representation of a long-running operation with progress reporting and cancellation.
|
|||
|
/// </summary>
|
|||
|
public interface IOperation
|
|||
|
{
|
|||
|
string? ProgressTitle { get; }
|
|||
|
|
|||
|
bool AllowCancel { get; }
|
|||
|
|
|||
|
bool AllowBackground { get; }
|
|||
|
|
|||
|
bool SkipExitPrompt { get; }
|
|||
|
|
|||
|
OperationStatus? Status { get; }
|
|||
|
|
|||
|
Task<bool>? Success { get; }
|
|||
|
|
|||
|
bool IsFinished { get; }
|
|||
|
|
|||
|
void Wait(CancellationToken cancelToken = default);
|
|||
|
|
|||
|
void Cancel();
|
|||
|
|
|||
|
event EventHandler StatusChanged;
|
|||
|
|
|||
|
event EventHandler Finished;
|
|||
|
|
|||
|
event EventHandler<OperationErrorEventArgs> Error;
|
|||
|
}
|