0

如何查看课堂调试过程中积累的所有文本?JsonWriterJsonConverter

class LookupConverter : JsonConverter
{
    public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
    {
        var lu = value as Lookup<string, MyClass>;
        foreach (var i in lu.SelectMany(nodes => nodes))
        {
            // I want to setup a breakpoint here and examine the 
            // "text" accumulated in `writer`...
        }
    }
    /*
    ...
    */
}
4

1 回答 1

0

好的,我知道了:

((Newtonsoft.Json.JsonTextWriter)(writer))._writer.ToString()
于 2013-10-20T15:21:38.133 回答