| | 1 | | using System.ComponentModel; |
| | 2 | | using System.Windows.Forms; |
| | 3 | |
|
| | 4 | | namespace PropertyGridHelpers.UIEditors |
| | 5 | | { |
| | 6 | | /// <summary> |
| | 7 | | /// Provides a type-safe <see cref="AutoCompleteComboBoxEditor"/> for editing enum-based |
| | 8 | | /// values in a <see cref="PropertyGrid"/>. This generic variant allows specifying a custom |
| | 9 | | /// <see cref="EnumConverter"/> to control display and parsing behavior. |
| | 10 | | /// </summary> |
| | 11 | | /// <typeparam name="T"> |
| | 12 | | /// A custom <see cref="EnumConverter"/> type that provides conversion logic for the target enum. |
| | 13 | | /// </typeparam> |
| | 14 | | /// <remarks> |
| | 15 | | /// This editor automatically creates an instance of <typeparamref name="T"/> and |
| | 16 | | /// assigns it to the <see cref="AutoCompleteComboBoxEditor.Converter"/> property, allowing |
| | 17 | | /// for customized enum text representation in the drop-down. |
| | 18 | | /// </remarks> |
| | 19 | | /// <seealso cref="AutoCompleteComboBoxEditor"/> |
| | 20 | | public class AutoCompleteComboBoxEditor<T> : AutoCompleteComboBoxEditor |
| | 21 | | where T : EnumConverter, new() |
| | 22 | | { |
| | 23 | | /// <summary> |
| | 24 | | /// Initializes a new instance of the <see cref="AutoCompleteComboBoxEditor{T}"/> class. |
| | 25 | | /// </summary> |
| 4 | 26 | | public AutoCompleteComboBoxEditor() => |
| 4 | 27 | | Converter = new T(); |
| | 28 | | } |
| | 29 | | } |