public static InteractivePrinter CreateProgressBarPrinter(string initialLine, string title, Func <object, string> formatter, Func <object, float> percentCalculator, Func <float, object, string> percentFormatter, int barWidth) { if (!AllowInteractivePrinting) { return(new NullPrinter()); } InteractivePrinter printer = new BarPrinter() { Before = title, Formatter = formatter, PercentCalculator = percentCalculator, PercentFormatter = percentFormatter, Width = barWidth }; printer.Start(initialLine); return(printer); }
public static InteractivePrinter CreateProgressBarPrinter(string initialLine, string title, Func<object, string> formatter, Func<object, float> percentCalculator, Func<float, object, string> percentFormatter, int barWidth) { if (!AllowInteractivePrinting) return new NullPrinter(); InteractivePrinter printer = new BarPrinter() { Before = title, Formatter = formatter, PercentCalculator = percentCalculator, PercentFormatter = percentFormatter, Width = barWidth }; printer.Start(initialLine); return printer; }