namespace Chronos.Controls.Editor { /// /// An option in an editor popup field. /// /// The type of the backing value. public class PopupOption { /// /// The backing value of the option. /// public T value; /// /// The visible label of the option. /// public string label; /// /// Initializes a new instance of the PopupOption class with the specified value. /// public PopupOption(T value) { this.value = value; this.label = value.ToString(); } /// /// Initializes a new instance of the PopupOption class with the specified value and label. /// public PopupOption(T value, string label) { this.value = value; this.label = label; } public static implicit operator T(PopupOption option) { return option.value; } } }