예제 #1
0
        public void Write(Table table)
        {
            using (var sw = new StreamWriter(_filename))
            {
                var rows = new List<Table.TableRow> {table.Header};
                rows.AddRange(table.Rows);

                foreach (var row in rows)
                {
                    var first = true;

                    foreach (var column in row.columns)
                    {
                        if (!first)
                            sw.Write(",");
                        else first = false;

                        sw.Write(PrepareCsvCol(column));
                    }

                    sw.Write(Environment.NewLine);
                }
            }
        }
예제 #2
0
파일: Parser.cs 프로젝트: bneuhold/pb-dev
 public Parser(Config config, Table.TableRow headerRow)
 {
     _table = new Table(headerRow.columns.Count)
                  {Header = headerRow};
     _config = config;
 }