public ChoConsolePercentageProgressorEx(string msg, int minPercentage, int maxPercentage, ChoConsolePercentageProgressorSettings consolePercentageProgressorSettings) { if (minPercentage >= maxPercentage) { throw new ArgumentException("MinPercentage should be < MaxPercentage."); } MinPercentage = minPercentage; MaxPercentage = maxPercentage; if (consolePercentageProgressorSettings == null) { _consolePercentageProgressorSettings = new ChoConsolePercentageProgressorSettings(); } else { _consolePercentageProgressorSettings = ChoObject.Clone(consolePercentageProgressorSettings) as ChoConsolePercentageProgressorSettings; } _padLength = MinPercentage.ToString().Length; if (MaxPercentage.ToString().Length > _padLength) { _padLength = MaxPercentage.ToString().Length; } _msg = NormalizeMethod(msg); }
public ChoConsoleSpinProgressor(string msg, ConsoleColor foregroundColor, ConsoleColor backgroundColor, ChoConsolePercentageProgressorSettings consolePercentageProgressorSettings) { _msg = NormalizeMethod(msg); _foregroundColor = foregroundColor; _backgroundColor = backgroundColor; if (consolePercentageProgressorSettings == null) { _consolePercentageProgressorSettings = new ChoConsolePercentageProgressorSettings(); } else { _consolePercentageProgressorSettings = ChoObject.Clone(consolePercentageProgressorSettings) as ChoConsolePercentageProgressorSettings; } }