예제 #1
0
        private static string Write( bool indent, bool produceAscii, Action<JsonWriter> action )
        {
            var sw = new StringWriter();
            using( var writer = new JsonWriter(sw, indent, produceAscii) )
            {
                action(writer);

                sw.Flush();
                return sw.ToString();
            }
        }
예제 #2
0
        private static string Write( CsvFormat csvFormat, Action<CsvWriter> action )
        {
            var sw = new StringWriter();
            using( var writer = new CsvWriter(sw, csvFormat) )
            {
                action(writer);

                sw.Flush();
                return sw.ToString();
            }
        }