I found a better solution than either of my initial ideas in another question that was recently asked.
parapura rajkumar was on the right track with the TypeConverter class, but the required exception handling for the CanConvertFrom
method for non-exceptional events was what I was trying to avoid.
The TypeConverter.IsValid
method solved my problem, although it is not ideal because the IsValid method is just a wrapper for the CanConvertFrom
method and the required exception handling.
private Boolean CanCovert(String value, Type type)
{
TypeConverter converter = TypeDescriptor.GetConverter(type);
return converter.IsValid(value);
}