public static string GetJson(XmlReader reader, ActionResultData result) { TkDebug.AssertArgumentNull(reader, "reader", null); StringBuilder builder = new StringBuilder(); using (XmlJsonWriter writer = new XmlJsonWriter(builder, result)) { WriteXmlUseXmlWriter(reader, writer); } return(builder.ToString()); }
public static MemoryStream GetJsonStream(XmlReader reader) { TkDebug.AssertArgumentNull(reader, "reader", null); MemoryStream stream = new MemoryStream(); XmlJsonWriter writer = new XmlJsonWriter(stream); using (writer) { WriteXmlUseXmlWriter(reader, writer); } return(stream); }
public static string GetJson(XmlReader reader, char quoteChar) { TkDebug.AssertArgumentNull(reader, "reader", null); StringBuilder builder = new StringBuilder(); using (XmlJsonWriter writer = new XmlJsonWriter(builder) { QuoteChar = quoteChar }) { WriteXmlUseXmlWriter(reader, writer); } return(builder.ToString()); }