ListViewEventArgs.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. namespace Terminal.Gui {
  3. /// <summary>
  4. /// <see cref="EventArgs"/> for <see cref="ListView"/> events.
  5. /// </summary>
  6. public class ListViewItemEventArgs : EventArgs {
  7. /// <summary>
  8. /// The index of the <see cref="ListView"/> item.
  9. /// </summary>
  10. public int Item { get; }
  11. /// <summary>
  12. /// The <see cref="ListView"/> item.
  13. /// </summary>
  14. public object Value { get; }
  15. /// <summary>
  16. /// Initializes a new instance of <see cref="ListViewItemEventArgs"/>
  17. /// </summary>
  18. /// <param name="item">The index of the <see cref="ListView"/> item.</param>
  19. /// <param name="value">The <see cref="ListView"/> item</param>
  20. public ListViewItemEventArgs (int item, object value)
  21. {
  22. Item = item;
  23. Value = value;
  24. }
  25. }
  26. /// <summary>
  27. /// <see cref="EventArgs"/> used by the <see cref="ListView.RowRender"/> event.
  28. /// </summary>
  29. public class ListViewRowEventArgs : EventArgs {
  30. /// <summary>
  31. /// The current row being rendered.
  32. /// </summary>
  33. public int Row { get; }
  34. /// <summary>
  35. /// The <see cref="Attribute"/> used by current row or
  36. /// null to maintain the current attribute.
  37. /// </summary>
  38. public Attribute? RowAttribute { get; set; }
  39. /// <summary>
  40. /// Initializes with the current row.
  41. /// </summary>
  42. /// <param name="row"></param>
  43. public ListViewRowEventArgs (int row)
  44. {
  45. Row = row;
  46. }
  47. }
  48. }