GraphCellToRender.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. namespace Terminal.Gui {
  3. /// <summary>
  4. /// Describes how to render a single row/column of a <see cref="GraphView"/> based
  5. /// on the value(s) in <see cref="ISeries"/> at that location
  6. /// </summary>
  7. public class GraphCellToRender {
  8. /// <summary>
  9. /// The character to render in the console
  10. /// </summary>
  11. public Rune Rune { get; set; }
  12. /// <summary>
  13. /// Optional color to render the <see cref="Rune"/> with
  14. /// </summary>
  15. public Attribute? Color { get; set; }
  16. /// <summary>
  17. /// Creates instance and sets <see cref="Rune"/> with default graph coloring
  18. /// </summary>
  19. /// <param name="rune"></param>
  20. public GraphCellToRender (Rune rune)
  21. {
  22. Rune = rune;
  23. }
  24. /// <summary>
  25. /// Creates instance and sets <see cref="Rune"/> with custom graph coloring
  26. /// </summary>
  27. /// <param name="rune"></param>
  28. /// <param name="color"></param>
  29. public GraphCellToRender (Rune rune, Attribute color) : this (rune)
  30. {
  31. Color = color;
  32. }
  33. /// <summary>
  34. /// Creates instance and sets <see cref="Rune"/> and <see cref="Color"/> (or default if null)
  35. /// </summary>
  36. public GraphCellToRender (Rune rune, Attribute? color) : this (rune)
  37. {
  38. Color = color;
  39. }
  40. }
  41. }