public static void WithTask(this IProgressContext ctx, string description, Action <IProgressTask> predicate) { var task = ctx.AddTask(description); predicate(task); task.StopTask(); }
public static async Task <T> WithTaskAsync <T>(this IProgressContext ctx, string description, Func <IProgressTask, Task <T> > predicate) { var task = ctx.AddTask(description); var result = await predicate(task); task.StopTask(); return(result); }
public static async Task WithTaskAsync(this IProgressContext ctx, string description, Func <IProgressTask, Task> predicate) { var task = ctx.AddTask(description); await predicate(task); task.StopTask(); }