using System.ComponentModel; using System.Globalization; namespace JD.Serialization { #region Typeconverter public class InputDescConverter : UAFObjectConverter { public override bool CanConvertTo(ITypeDescriptorContext context, System.Type destinationType) { if (destinationType == typeof(InputDesc)) return true; return base.CanConvertTo(context, destinationType); } public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, System.Type destinationType) { if (destinationType == typeof(System.String) && value is InputDesc) { InputDesc desc = (InputDesc)value; return desc.Name.ToString() + " (" + desc.VarType.ToString() + ") " + GetTableInfo(value); } return base.ConvertTo(context, culture, value, destinationType); } } #endregion [TypeConverter(typeof(InputDescConverter))] public partial class InputDesc { } }