public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (null == destinationType)
{
throw ADP.ArgumentNull(nameof(destinationType));
}
if ((typeof(InstanceDescriptor) == destinationType) && (value is DataColumnMapping))
{
DataColumnMapping mapping = (DataColumnMapping)value;
object[] values = new object[] { mapping.SourceColumn, mapping.DataSetColumn };
Type[] types = new Type[] { typeof(string), typeof(string) };
ConstructorInfo ctor = typeof(DataColumnMapping).GetConstructor(types);
return new InstanceDescriptor(ctor, values);
}
return base.ConvertTo(context, culture, value, destinationType);
}
}