예제 #1
0
        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);
        }
예제 #2
0
        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;
        }