< Summary - PropertyGridHelpers Code Coverage

Information
Class: PropertyGridHelpers.UIEditors.FlagEnumUIEditor
Assembly: PropertyGridHelpers
File(s): File 1: C:\Agent\_work\2\s\Code\PropertyGridHelpers\UIEditors\FlagEnumUIEditor.cs
File 2: C:\Agent\_work\2\s\Code\PropertyGridHelpers\UIEditors\FlagEnumUIEditorT.cs
Tag: PropertyGridHelpers Build_2026.1.11.1_#580
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 88
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 3/4/2025 - 9:39:23 PM Line coverage: 100% (38/38) Branch coverage: 100% (18/18) Total lines: 115 Tag: PropertyGridHelpers Build_2025.3.4.1_#3774/26/2025 - 10:25:01 PM Line coverage: 100% (37/37) Branch coverage: 100% (18/18) Total lines: 113 Tag: PropertyGridHelpers Build_2025.4.26.1_#3865/4/2025 - 8:18:24 PM Line coverage: 100% (37/37) Branch coverage: 100% (18/18) Total lines: 113 Tag: PropertyGridHelpers Build_2025.5.4.1_#3905/11/2025 - 9:14:15 PM Line coverage: 100% (2/2) Total lines: 43 Tag: PropertyGridHelpers Build_2025.5.11.1_#3915/23/2025 - 7:21:57 PM Line coverage: 100% (2/2) Total lines: 43 Tag: Test PropertyGridHelpers Build_2025.5.23.2_#4261/10/2026 - 4:46:27 PM Line coverage: 100% (4/4) Total lines: 88 Tag: PropertyGridHelpers Build_2026.1.10.1_#579 3/4/2025 - 9:39:23 PM Line coverage: 100% (38/38) Branch coverage: 100% (18/18) Total lines: 115 Tag: PropertyGridHelpers Build_2025.3.4.1_#3774/26/2025 - 10:25:01 PM Line coverage: 100% (37/37) Branch coverage: 100% (18/18) Total lines: 113 Tag: PropertyGridHelpers Build_2025.4.26.1_#3865/4/2025 - 8:18:24 PM Line coverage: 100% (37/37) Branch coverage: 100% (18/18) Total lines: 113 Tag: PropertyGridHelpers Build_2025.5.4.1_#390

Metrics

MethodBlocks covered Blocks not covered Branch coverage Crap Score Cyclomatic complexity Line coverage
File 1: FlagEnumUIEditor()40----
File 1: .ctor()--100%11100%
File 2: FlagEnumUIEditor()50----

File(s)

C:\Agent\_work\2\s\Code\PropertyGridHelpers\UIEditors\FlagEnumUIEditor.cs

#LineLine coverage
 1using PropertyGridHelpers.Controls;
 2using System.ComponentModel;
 3using System.Drawing.Design;
 4using System.Windows.Forms;
 5
 6namespace PropertyGridHelpers.UIEditors
 7{
 8    /// <summary>
 9    /// A reusable <see cref="UITypeEditor"/> for editing [Flags]-decorated enums
 10    /// in a <see cref="PropertyGrid"/> using a drop-down checklist.
 11    /// </summary>
 12    /// <remarks>
 13    /// This editor hosts a <see cref="FlagCheckedListBox"/> inside a drop-down
 14    /// and is intended for use with enumerations marked with the
 15    /// <see cref="System.FlagsAttribute"/>. The drop-down allows users to
 16    /// select multiple values by checking corresponding options.
 17    ///
 18    /// The control handles bitwise logic internally, updating the composite
 19    /// enum value based on the user's selection.
 20    ///
 21    /// Example usage:
 22    /// <code>
 23    /// [Editor(typeof(FlagEnumUIEditor), typeof(UITypeEditor))]
 24    /// public MyFlagsEnum Options { get; set; }
 25    /// </code>
 26    ///
 27    /// To customize the display text for enum values, consider using
 28    /// <see cref="FlagEnumUIEditor{T}"/> with an <see cref="EnumConverter"/>.
 29    /// </remarks>
 30    /// <seealso cref="DropDownVisualizer{TControl}"/>
 31    /// <seealso cref="FlagCheckedListBox"/>
 32    /// <seealso cref="System.FlagsAttribute"/>
 33    /// <seealso cref="UITypeEditor"/>
 34    public partial class FlagEnumUIEditor : DropDownVisualizer<FlagCheckedListBox>
 35    {
 36        /// <summary>
 37        /// Initializes a new instance of the <see cref="FlagEnumUIEditor"/> class,
 38        /// configuring the drop-down checklist style.
 39        /// </summary>
 3240        public FlagEnumUIEditor() : base() =>
 3241            DropDownControl.BorderStyle = BorderStyle.None;
 42    }
 43}

C:\Agent\_work\2\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}