GraphCellToRender.cs 1.2 KB

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