GraphCellToRender.cs 1.1 KB

123456789101112131415161718192021222324252627
  1. #nullable disable
  2. namespace Terminal.Gui.Views;
  3. /// <summary>
  4. /// Describes how to render a single row/column of a <see cref="GraphView"/> based on the value(s) in
  5. /// <see cref="ISeries"/> at that location
  6. /// </summary>
  7. public class GraphCellToRender
  8. {
  9. /// <summary>Creates instance and sets <see cref="Rune"/> with default graph coloring</summary>
  10. /// <param name="rune"></param>
  11. public GraphCellToRender (Rune rune) { Rune = rune; }
  12. /// <summary>Creates instance and sets <see cref="Rune"/> with custom graph coloring</summary>
  13. /// <param name="rune"></param>
  14. /// <param name="color"></param>
  15. public GraphCellToRender (Rune rune, Attribute color) : this (rune) { Color = color; }
  16. /// <summary>Creates instance and sets <see cref="Rune"/> and <see cref="Color"/> (or default if null)</summary>
  17. public GraphCellToRender (Rune rune, Attribute? color) : this (rune) { Color = color; }
  18. /// <summary>Optional color to render the <see cref="Rune"/> with</summary>
  19. public Attribute? Color { get; set; }
  20. /// <summary>The character to render in the console</summary>
  21. public Rune Rune { get; set; }
  22. }