public override void Draw( bool isCurrentLine, Log log, ConsoleConfig config ) { Console.ResetColor(); ConsoleColor fg; if (config.IsHeader) { Console.BackgroundColor = config.HeaderBackgroundColor; fg = config.HeaderForegroundColor; } else { fg = Console.ForegroundColor; } log.Add(Glyph.GetInicator(isCurrentLine), config.CurLineIndicatorColor); log.Add(Check, config.CheckColor(Checked)); log.Add(" "); log.Add(Display, fg); log.Add(DisplayValueGap(config)); log.Add(Money(), config.ValueColor); log.Add(CountGap(config)); log.Add(Count.ToString(), config.CountColor); log.Add(" "); // log.Print(!config.Drawn); log.Print(false); Console.ResetColor(); }
// private bool _Checked; // public int Count { get; private set; } // public override bool Checked // { // get { return _Checked; } // set // { // _Checked = value; // if (value) // { // Count = 1; // } // else // { // Count = 0; // } // } // } // public override void ToggleBoolValue() // { // Checked = !Checked; // } // public void Inc() // { // if (Checked) // { // Count++; // } // } // public void Dec() // { // if (Checked && Count > 1) // { // Count--; // } // } private string DisplayValueGap(ConsoleConfig config) { int displayGap = config.MaxDisplayWidth - Display.Length + 1; int valueGap = config.ValueWidth - Money().Length; return(new String(' ', displayGap + valueGap)); }
public override void Draw(bool isCurrentLine, Log log, ConsoleConfig config) { Console.ResetColor(); log.Add(Display, config.ListTitleColor); // log.Print(!config.Drawn); log.Print(false); }
public override void Draw(bool isCurrentLine, Log log, ConsoleConfig config) { Console.ResetColor(); Console.BackgroundColor = config.HeaderBackgroundColor; log.Add(" "); log.Add(Display, config.HeaderForegroundColor); log.Add(EndSpace(config)); log.Print(false); Console.ResetColor(); }
public override void Draw(bool isCurrentLine, Log log, ConsoleConfig config) { log.Add(Glyph.GetInicator(isCurrentLine), config.CurLineIndicatorColor); log.Add(new String(' ', DisplayLength - Display.Length)); log.Add($"{Display} ", config.TextInputTagColor); log.Add(Value, config.TextInputColor); log.Add(new String(' ', Console.WindowWidth - Console.CursorLeft)); log.Print(false); Console.ResetColor(); }
private string Dots(ConsoleConfig config) { int totalLen; // _ denotes spaces // MAX-DISPLAY-WIDTH_VALUE-WIDTH_COUNT-WIDTH_ // DISPLAY .......... 001_ totalLen = config.MaxDisplayWidth + 1 + config.ValueWidth + 1 + config.CountWidth + 1; return(new String('.', totalLen - Display.Length - 1 - 1 - config.CountWidth - 1)); }
private string EndSpace(ConsoleConfig config) { return(new String( ' ', Glyph.CheckTrue.Length + Glyph.LineIndicator.Length + config.MaxDisplayWidth - Display.Length + 1 + config.ValueWidth + 1 + config.CountWidth + 1 )); }
public override void Draw(bool isCurrentLine, Log log, ConsoleConfig config) { int width = config.Width - 1; string total = Value.ToString("C2"); string spaces = new String(' ', width - total.Length - Display.Length - 1 - config.CountWidth - 1); log.Add(spaces); log.Add(Display, config.TotalColor); log.Add(" "); log.Add(total, config.TotalColor); log.Add(" "); log.Print(false); }
public override void Draw(bool isCurrentLine, Log log, ConsoleConfig config) { Console.ResetColor(); ConsoleColor color = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), Display); log.Add(Glyph.GetInicator(isCurrentLine), config.CurLineIndicatorColor); log.Add(Check, config.CheckColor(Checked)); log.Add(" "); log.Add(Display, color); log.Add(endSpace(config)); log.Print(false); Console.ResetColor(); }
private string endSpace(ConsoleConfig config) { int totalLen; if (config.IsHeader) { // _ denotes spaces // MAX-DISPLAY-WIDTH_VALUE-WIDTH_COUNT-WIDTH_ totalLen = config.MaxDisplayWidth + 1 + config.ValueWidth + 1 + config.CountWidth + 1; } else { totalLen = config.MaxDisplayWidth; } return(new String(' ', totalLen - Display.Length)); }
public override void Draw(bool isCurrentLine, Log log, ConsoleConfig config) { ConsoleColor fg = config.SelectableLineColor; ConsoleColor bg = config.BackgroundColor; if (isCurrentLine) { fg = config.SelectableLineTextColor; bg = config.SelectableLineColor; } Console.ForegroundColor = config.CurLineIndicatorColor; Console.Write(Glyph.GetInicator(isCurrentLine)); Console.BackgroundColor = bg; Console.ForegroundColor = fg; string text = Display + new String(' ', config.Width - Glyph.GetInicator(isCurrentLine).Length - Display.Length); Console.Write(text); Console.ResetColor(); }
public override void Draw(bool isCurrentLine, Log log, ConsoleConfig config) { Console.ResetColor(); ConsoleColor fg; if (config.IsHeader) { Console.BackgroundColor = config.HeaderBackgroundColor; fg = config.HeaderForegroundColor; } else { fg = Console.ForegroundColor; } log.Add(Glyph.GetInicator(isCurrentLine), config.CurLineIndicatorColor); log.Add(Check, config.CheckColor(Checked)); log.Add(" "); log.Add(Display, fg); log.Add(endSpace(config)); log.Print(false); Console.ResetColor(); }
private string CountGap(ConsoleConfig config) { int spaceCount = config.CountWidth - Count.ToString().Length + 1; return(new String(' ', spaceCount)); }
private string CountGap(ConsoleConfig config) { return(new String(' ', config.CountWidth - Count.ToString().Length)); }
private string endSpace(ConsoleConfig config) { int totalLen = config.MaxDisplayWidth; return(new String(' ', totalLen - Display.Length)); }
public abstract void Draw( bool isCurrentLine, Log log, ConsoleConfig config );