Exemplo n.º 1
0
        private void ExportTables([NotNull] string fileName, [NotNull] List <QueryAnalyzer.ResultDataTable> dataTables)
        {
            Debug.ArgumentNotNull(fileName, nameof(fileName));
            Debug.ArgumentNotNull(dataTables, nameof(dataTables));

            using (var writer = new StreamWriter(fileName, false, Encoding.UTF8))
            {
                var output = new XmlTextWriter(writer)
                {
                    Indentation = 2,
                    Formatting  = Formatting.Indented,
                    IndentChar  = ' '
                };

                var exporter = new QueryExporter();

                exporter.ExportTables(output, dataTables, string.Empty);

                output.Flush();

                writer.Close();
            }
        }
Exemplo n.º 2
0
        private string ExportTables([NotNull] List <QueryAnalyzer.ResultDataTable> dataTables)
        {
            Debug.ArgumentNotNull(dataTables, nameof(dataTables));

            using (var writer = new StringWriter())
            {
                var output = new XmlTextWriter(writer)
                {
                    Indentation = 2,
                    Formatting  = Formatting.Indented,
                    IndentChar  = ' '
                };

                var exporter = new QueryExporter();

                exporter.ExportTables(output, dataTables, "Query Analyzer");

                output.Flush();

                writer.Close();

                return(writer.ToString());
            }
        }