public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) {
if (value is string) {
string text = ((string)value).Trim();
try {
return Boolean.Parse(text);
}
catch (FormatException e) {
throw new FormatException(SR.GetString(SR.ConvertInvalidPrimitive, (string)value, "Boolean"), e);
}
}
return base.ConvertFrom(context, culture, value);
}