namespace PARR.Core.Common.Interfaces
{
///
/// Отслеживание програсса (% от задачи)
///
///
public interface IProgressAsync
{
///
/// Установить значение програсса (%)
///
///
///
Task ReportAsync(T value);
}
///
/// Отслеживание програсса (% от задачи)
///
///
public class ProgressAsync : IProgressAsync
{
private readonly Func _handler;
///
/// Отслеживание програсса (% от задачи)
///
///
public ProgressAsync(Func handler)
{
_handler = handler;
}
public Task ReportAsync(T value)
{
return _handler(value);
}
}
}