SliderEventArgs.cs 982 B

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