コード例 #1
0
        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));
        }
コード例 #2
0
 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));
 }