public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { object result; if (value is string s && !string.IsNullOrEmpty(s)) { result = UserTuple.Parse(s); }
public static bool TryParse(string s, out UserTuple result) { bool success; try { result = UserTuple.Parse(s); success = true; } catch { success = false; result = default; } return(success); }