public static bool RunBatchCommand( this IExecutable executable, ArgumentString[] batchArguments, byte[] input = null, bool createWindow = false) { return(batchArguments.Aggregate(true, (result, arguments) => executable.RunCommand(arguments, input, createWindow) && result)); }
public static bool RunBatchCommand( this IExecutable executable, ICollection <BatchArgumentItem> batchArguments, Action <BatchProgressEventArgs>?action = null, byte[]?input = null, bool createWindow = false) { int total = batchArguments.Sum(item => item.BatchItemsCount); var result = true; foreach (var item in batchArguments) { result &= executable.RunCommand(item.Argument, input, createWindow); // Invoke batch progress callback action?.Invoke(new BatchProgressEventArgs(item.BatchItemsCount, result)); } return(result); }