SelectionChangedEventArgs.cs 936 B

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