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