2023-09-24 17:26:46 -04:00
|
|
|
|
using System.ComponentModel;
|
2022-10-04 11:06:09 -04:00
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2017-11-27 13:11:20 -05:00
|
|
|
|
using System.Globalization;
|
|
|
|
|
|
2023-03-31 11:47:53 -04:00
|
|
|
|
namespace Vanara.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
internal class BetterExpandableObjectConverter : ExpandableObjectConverter
|
2017-11-27 13:11:20 -05:00
|
|
|
|
{
|
2023-03-31 11:47:53 -04:00
|
|
|
|
// Methods
|
|
|
|
|
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) =>
|
|
|
|
|
destinationType == typeof(string) ? string.Empty : base.ConvertTo(context, culture, value, destinationType);
|
2017-11-27 13:11:20 -05:00
|
|
|
|
|
2022-10-04 11:06:09 -04:00
|
|
|
|
#if NET6_0_OR_GREATER
|
2023-03-31 11:47:53 -04:00
|
|
|
|
[RequiresUnreferencedCode(null)]
|
2022-10-04 11:06:09 -04:00
|
|
|
|
#endif
|
2023-03-31 11:47:53 -04:00
|
|
|
|
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) =>
|
|
|
|
|
TypeDescriptor.GetProperties(value, attributes);
|
2017-11-27 13:11:20 -05:00
|
|
|
|
}
|