Is it not possible to specify the Indentation when using JsonConvert.SerializeObject ?

Feb 4, 2012 at 10:20 PM

According to the current documentation of the static method JsonConvert.SerializeObject, the Formatting parameter indicates how the output is formatted.

( http://james.newtonking.com/projects/json/help/html/M_Newtonsoft_Json_JsonConvert_SerializeObject_1.htm )


According to the documentation of the enum Formatting.Indented, it causes child objects to be indented according to the Indentation and IndentChar settings.

( http://james.newtonking.com/projects/json/help/html/T_Newtonsoft_Json_Formatting.htm )

 

The latter two properties are non-static properties of class JsonTextWriter.

( http://james.newtonking.com/projects/json/help/html/T_Newtonsoft_Json_JsonTextWriter.htm )

 

My question is, how do you set the Indentation/IndentChar properties of the JsonTextWriter instance that the static method JsonConvert.SerializeObject uses ?