< Summary - PropertyGridHelpers Code Coverage

Information
Class: PropertyGridHelpers.UIEditors.FlagEnumUIEditor<T>
Assembly: PropertyGridHelpers
File(s): c:\agent\_work\9\s\Code\PropertyGridHelpers\UIEditors\FlagEnumUIEditorT.cs
Tag: PropertyGridHelpers Build_2025.7.15.1_#485
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 45
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBlocks covered Blocks not covered
FlagEnumUIEditor()50

File(s)

c:\agent\_work\9\s\Code\PropertyGridHelpers\UIEditors\FlagEnumUIEditorT.cs

#LineLine coverage
 1using PropertyGridHelpers.Controls;
 2using System;
 3using System.ComponentModel;
 4using System.Drawing.Design;
 5using System.Windows.Forms;
 6
 7namespace PropertyGridHelpers.UIEditors
 8{
 9    /// <summary>
 10    /// A generic <see cref="UITypeEditor"/> for editing flag-style enums in a <see cref="PropertyGrid"/>,
 11    /// with support for customized display text using a specified <see cref="EnumConverter"/>.
 12    /// </summary>
 13    /// <typeparam name="T">
 14    /// The <see cref="EnumConverter"/> type used to convert enum values to user-friendly display text.
 15    /// Must have a parameterless constructor.
 16    /// </typeparam>
 17    /// <remarks>
 18    /// This editor uses a <see cref="FlagCheckedListBox"/> hosted in a dropdown and allows
 19    /// multiple values to be selected for enums decorated with the <see cref="FlagsAttribute"/>.
 20    ///
 21    /// The generic parameter <typeparamref name="T"/> allows you to specify a custom converter,
 22    /// such as <see cref="Converters.EnumTextConverter{TEnum}"/>, to localize or stylize enum values.
 23    ///
 24    /// Example:
 25    /// <code>
 26    /// [Editor(typeof(FlagEnumUIEditor&lt;EnumTextConverter&lt;MyEnum&gt;&gt;), typeof(UITypeEditor))]
 27    /// [TypeConverter(typeof(EnumTextConverter&lt;MyEnum&gt;))]
 28    /// public MyEnum Options { get; set; }
 29    /// </code>
 30    /// </remarks>
 31    /// <seealso cref="DropDownVisualizer{FlagCheckedListBox}"/>
 32    /// <seealso cref="FlagEnumUIEditor"/>
 33    /// <seealso cref="FlagCheckedListBox"/>
 34    /// <seealso cref="Converters.EnumTextConverter{T}"/>
 35    public partial class FlagEnumUIEditor<T>
 36        : DropDownVisualizer<FlagCheckedListBox>
 37        where T : EnumConverter, new()
 38    {
 39        /// <summary>
 40        /// Initializes a new instance of the <see cref="FlagEnumUIEditor" /> class.
 41        /// </summary>
 1642        public FlagEnumUIEditor() : base() =>
 1643            DropDownControl.Converter = new T();
 44    }
 45}

Methods/Properties

FlagEnumUIEditor()