Hi ThirstyMind,
A custom TypeConverter is not hard to implement. Generally we need toderive a class from the TypeConverter class and override the CanConvertTo, CanConvertFrom, ConvertTo and ConvertFrom methods. In your scenario, you only need to override the ConvertTo method.
The following is a sample:
class myclass
{
private string[] str;
[TypeConverter(typeof(MyConverter))]
public string[] Str
{
get { return str; }
set { str = value; }
}
}
class MyConverter : TypeConverter
{
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
return "Select File Names";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
Hope this helps.
If you have any question, please feel free to let me know.
Linda