public override object ReadJson(JsonReader reader, Type objectType, object?existingValue, JsonSerializer serializer) { var value = (string)reader.Value !; // ReSharper disable once HeapView.BoxingAllocation return(LTag.Parse(value)); }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string s) { // ReSharper disable once HeapView.BoxingAllocation return(LTag.Parse(s)); } return(base.ConvertFrom(context, culture, value)); }