public ProgressTask <TNewResult> Then <TNewResult>(Func <List <TResult>, List <TNewResult> > func, string operationDescription) { if (ValueEmpty()) { return(Empty <TNewResult>()); } return(new ProgressTask <TNewResult>(() => { cmdlet.OperationTypeDescription = operationDescription; cmdlet.DisplayProgress(false); return func(task.Value); }, cmdlet)); }
/// <summary> /// Create a sequence of progress tasks for processing a process containing two or more operations. /// </summary> /// <typeparam name="TNewResult">The type of object returned by the first operation.</typeparam> /// <param name="func">The first operation to execute.</param> /// <param name="cmdlet">The cmdlet that should display progress.</param> /// <param name="typeDescription">The type description use for the progress.</param> /// <param name="operationDescription">The progress description to use for the first operation.</param> /// <returns></returns> public static ProgressTask <TNewResult> Create <TNewResult>(Func <List <TNewResult> > func, PrtgProgressCmdlet cmdlet, string typeDescription, string operationDescription) { return(new ProgressTask <TNewResult>(() => { cmdlet.TypeDescription = typeDescription; cmdlet.OperationTypeDescription = operationDescription; cmdlet.DisplayProgress(false); return func(); }, cmdlet)); }