Accessing the current JsonToken during serialization

Dec 29, 2009 at 11:26 PM

I am using a project called codeXS to generate objects from xsds that govern the objects within my system.  When serializing the generated object to json, it creates a bloated json structure because of duplicate structures that it creates within the codeXS generated object (it adds collection support for example for any arrays that exist, and it injects the entire Xml string for each node).  I am attempting to construct a Converter to deal with these duplicate structures.  However, i am having difficulty determining exactly which object or property is being processed within the CanConvert or WriteJson methods of my converter...  Is there any way to identify the current token being processed from within these methods?  I cant see how to get at the attrib or obj name that is being added to the writer.