SelectedCellChangedEventArgs.cs 1.7 KB

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