SliderEventArgs.cs 1007 B

12345678910111213141516171819202122232425
  1. #nullable disable
  2. namespace Terminal.Gui.Views;
  3. /// <summary><see cref="EventArgs"/> for <see cref="Slider{T}"/> events.</summary>
  4. public class SliderEventArgs<T> : EventArgs
  5. {
  6. /// <summary>Initializes a new instance of <see cref="SliderEventArgs{T}"/></summary>
  7. /// <param name="options">The current options.</param>
  8. /// <param name="focused">Index of the option that is focused. -1 if no option has the focus.</param>
  9. public SliderEventArgs (Dictionary<int, SliderOption<T>> options, int focused = -1)
  10. {
  11. Options = options;
  12. Focused = focused;
  13. Cancel = false;
  14. }
  15. /// <summary>If set to true, the focus operation will be canceled, if applicable.</summary>
  16. public bool Cancel { get; set; }
  17. /// <summary>Gets or sets the index of the option that is focused.</summary>
  18. public int Focused { get; set; }
  19. /// <summary>Gets/sets whether the option is set or not.</summary>
  20. public Dictionary<int, SliderOption<T>> Options { get; set; }
  21. }