using OF_DL.Services; namespace OF_DL.Gui.Services; internal sealed class AvaloniaProgressReporter( Action reportAction, Func isCancellationRequested) : IProgressReporter { public void ReportProgress(long increment) { if (isCancellationRequested()) { throw new OperationCanceledException("Operation canceled by user."); } if (increment > 0) { reportAction(increment); } } }