2
0

SelectionChangedEventArgs.cs 989 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. namespace Terminal.Gui {
  3. /// <summary>
  4. /// Event arguments describing a change in selected object in a tree view
  5. /// </summary>
  6. public class SelectionChangedEventArgs<T> : EventArgs where T : class {
  7. /// <summary>
  8. /// The view in which the change occurred
  9. /// </summary>
  10. public TreeView<T> Tree { get; }
  11. /// <summary>
  12. /// The previously selected value (can be null)
  13. /// </summary>
  14. public T OldValue { get; }
  15. /// <summary>
  16. /// The newly selected value in the <see cref="Tree"/> (can be null)
  17. /// </summary>
  18. public T NewValue { get; }
  19. /// <summary>
  20. /// Creates a new instance of event args describing a change of selection
  21. /// in <paramref name="tree"/>
  22. /// </summary>
  23. /// <param name="tree"></param>
  24. /// <param name="oldValue"></param>
  25. /// <param name="newValue"></param>
  26. public SelectionChangedEventArgs (TreeView<T> tree, T oldValue, T newValue)
  27. {
  28. Tree = tree;
  29. OldValue = oldValue;
  30. NewValue = newValue;
  31. }
  32. }
  33. }