SelectedCellChangedEventArgs.cs 1.7 KB

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