public ConvertFrom ( ITypeDescriptorContext context, System culture, object value ) : object | ||
context | ITypeDescriptorContext | The container representing this System.ComponentModel.TypeDescriptor. |
culture | System | Culture info for assembly. |
value | object | Data to convert. |
return | object |
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
var stringValue = (string)value;
var result = Type.GetType(stringValue, false);
if (result == null)
{
throw new ArgumentException(string.Format(Resources.Culture, Resources.ExceptionInvalidType, stringValue));
}
return result;
}