CellColorGetterArgs.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// Arguments for a <see cref="CellColorGetterDelegate"/>. Describes a cell for which a rendering
  4. /// <see cref="ColorScheme"/> is being sought
  5. /// </summary>
  6. public class CellColorGetterArgs {
  7. /// <summary>
  8. /// The data table hosted by the <see cref="TableView"/> control.
  9. /// </summary>
  10. public ITableSource Table { get; }
  11. /// <summary>
  12. /// The index of the row in <see cref="Table"/> for which color is needed
  13. /// </summary>
  14. public int RowIndex { get; }
  15. /// <summary>
  16. /// The index of column in <see cref="Table"/> for which color is needed
  17. /// </summary>
  18. public int ColIdex { get; }
  19. /// <summary>
  20. /// The hard typed value being rendered in the cell for which color is needed
  21. /// </summary>
  22. public object CellValue { get; }
  23. /// <summary>
  24. /// The textual representation of <see cref="CellValue"/> (what will actually be drawn to the screen)
  25. /// </summary>
  26. public string Representation { get; }
  27. /// <summary>
  28. /// the color scheme that is going to be used to render the cell if no cell specific color scheme is returned
  29. /// </summary>
  30. public ColorScheme RowScheme { get; }
  31. internal CellColorGetterArgs (ITableSource table, int rowIdx, int colIdx, object cellValue, string representation, ColorScheme rowScheme)
  32. {
  33. Table = table;
  34. RowIndex = rowIdx;
  35. ColIdex = colIdx;
  36. CellValue = cellValue;
  37. Representation = representation;
  38. RowScheme = rowScheme;
  39. }
  40. }