SelectionChangedEventArgs.cs 960 B

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