public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { var text = value as string; if (text != null) { AngularSpeedUnit result; if (AngularSpeedUnit.TryParse(text, out result)) { return(result); } var message = $"Could not convert the string '{text}' to an instance of AngularSpeedUnit)"; throw new NotSupportedException(message); } return(base.ConvertFrom(context, culture, value)); }