/// <summary> /// Converts the given object to the converter's native type. /// </summary> public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string) { return(com2Enum.FromString((string)value)); } return(base.ConvertFrom(context, culture, value)); }
/// <summary> /// Converts the given object to the converter's native type. /// </summary> public override object?ConvertFrom(ITypeDescriptorContext?context, CultureInfo?culture, object value) { if (value is string valueAsString) { return(_com2Enum.FromString(valueAsString)); } return(base.ConvertFrom(context, culture, value)); }