示例#1
0
        static void PrintTable <T>(Table <T> table) where T : DB.Row, new()
        {
            PrintFunc(typeof(T).FullName);

            var colHeaders = new List <string>();

            table.Cols.ForEach(x => colHeaders.Add(x.Name));

            var printer = new TablePrinter();

            printer.SetHeaders(colHeaders.ToArray());

            foreach (var row in table.Rows)
            {
                var cols = new List <string>();
                table.Cols.ForEach(x => cols.Add(row.GetValueString(x)));
                printer.AddRow(cols.ToArray());
            }

            Console.WriteLine(printer.ToString());
        }