< Summary - PropertyGridHelpers Code Coverage

Information
Class: PropertyGridHelpers.Converters.EnumTextConverter<T>
Assembly: PropertyGridHelpers
File(s): c:\agent\_work\9\s\Code\PropertyGridHelpers\Converters\EnumTextConverterT.cs
Tag: PropertyGridHelpers Build_2025.7.15.1_#485
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 48
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

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%

File(s)

c:\agent\_work\9\s\Code\PropertyGridHelpers\Converters\EnumTextConverterT.cs

#LineLine coverage
 1using PropertyGridHelpers.Attributes;
 2using System;
 3using System.ComponentModel;
 4using System.Windows.Forms;
 5
 6namespace PropertyGridHelpers.Converters
 7{
 8    /// <summary>
 9    /// A strongly-typed generic version of <see cref="EnumTextConverter"/> for handling enums with
 10    /// display text annotations in a <see cref="PropertyGrid"/>.
 11    /// </summary>
 12    /// <typeparam name="T">
 13    /// The enumeration type whose members are decorated with <see cref="EnumTextAttribute"/>.
 14    /// </typeparam>
 15    /// <remarks>
 16    /// This converter simplifies using <see cref="EnumTextAttribute"/> on enum members
 17    /// by automatically associating the generic parameter <typeparamref name="T"/> as
 18    /// the enum to convert. This enables the property grid to display friendly
 19    /// names for enum values without requiring manual type configuration.
 20    /// </remarks>
 21    /// <example>
 22    /// <code>
 23    /// public enum Status
 24    /// {
 25    ///     [EnumText("Pending Approval")]
 26    ///     Pending,
 27    ///
 28    ///     [EnumText("Approved")]
 29    ///     Approved,
 30    ///
 31    ///     [EnumText("Rejected")]
 32    ///     Rejected
 33    /// }
 34    ///
 35    /// [TypeConverter(typeof(EnumTextConverter&lt;Status&gt;))]
 36    /// public Status CurrentStatus { get; set; }
 37    /// </code>
 38    /// </example>
 39    /// <seealso cref="EnumTextAttribute"/>
 40    /// <seealso cref="EnumConverter"/>
 41    public partial class EnumTextConverter<T> : EnumTextConverter where T : Enum
 42    {
 43        /// <summary>
 44        /// Initializes a new instance of the <see cref="EnumTextConverter" /> class.
 45        /// </summary>
 27646        public EnumTextConverter() : base(typeof(T)) { }
 47    }
 48}

Methods/Properties

.ctor()