SelectedCellChangedEventArgs.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #nullable disable
  2. namespace Terminal.Gui.Views;
  3. /// <summary>Defines the event arguments for <see cref="TableView.SelectedCellChanged"/></summary>
  4. public class SelectedCellChangedEventArgs : EventArgs
  5. {
  6. /// <summary>
  7. /// Creates a new instance of arguments describing a change in selected cell in a <see cref="TableView"/>
  8. /// </summary>
  9. /// <param name="t"></param>
  10. /// <param name="oldCol"></param>
  11. /// <param name="newCol"></param>
  12. /// <param name="oldRow"></param>
  13. /// <param name="newRow"></param>
  14. public SelectedCellChangedEventArgs (ITableSource t, int oldCol, int newCol, int oldRow, int newRow)
  15. {
  16. Table = t;
  17. OldCol = oldCol;
  18. NewCol = newCol;
  19. OldRow = oldRow;
  20. NewRow = newRow;
  21. }
  22. /// <summary>The newly selected column index.</summary>
  23. /// <value></value>
  24. public int NewCol { get; }
  25. /// <summary>The newly selected row index.</summary>
  26. /// <value></value>
  27. public int NewRow { get; }
  28. /// <summary>
  29. /// The previous selected column index. May be invalid e.g. when the selection has been changed as a result of
  30. /// replacing the existing Table with a smaller one
  31. /// </summary>
  32. /// <value></value>
  33. public int OldCol { get; }
  34. /// <summary>
  35. /// The previous selected row index. May be invalid e.g. when the selection has been changed as a result of
  36. /// deleting rows from the table
  37. /// </summary>
  38. /// <value></value>
  39. public int OldRow { get; }
  40. /// <summary>
  41. /// The current table to which the new indexes refer. May be null e.g. if selection change is the result of
  42. /// clearing the table from the view
  43. /// </summary>
  44. /// <value></value>
  45. public ITableSource Table { get; }
  46. }