namespace Terminal.Gui;
/// Represents an option in a .
/// Data type of the option.
public class SliderOption
{
/// Creates a new empty instance of the class.
public SliderOption () { }
/// Creates a new instance of the class with values for each property.
public SliderOption (string legend, Rune legendAbbr, T data)
{
Legend = legend;
LegendAbbr = legendAbbr;
Data = data;
}
/// Event fired when an option has changed.
public event EventHandler Changed;
/// Custom data of the option.
public T Data { get; set; }
/// Legend of the option.
public string Legend { get; set; }
///
/// Abbreviation of the Legend. When the too small to fit
/// .
///
public Rune LegendAbbr { get; set; }
/// Event Raised when this option is set.
public event EventHandler Set;
/// Creates a human-readable string that represents this .
public override string ToString () { return "{Legend=" + Legend + ", LegendAbbr=" + LegendAbbr + ", Data=" + Data + "}"; }
/// Event Raised when this option is unset.
public event EventHandler UnSet;
/// To Raise the event from the Slider.
internal void OnChanged (bool isSet) { Changed?.Invoke (this, new (isSet)); }
/// To Raise the event from the Slider.
internal void OnSet () { Set?.Invoke (this, new (true)); }
/// To Raise the event from the Slider.
internal void OnUnSet () { UnSet?.Invoke (this, new (false)); }
}