public void TestMethod1() { { string[] headers = { "Test", "Header" }; string[][] data = { new[] { "Foo", "Bar" }, new[] { "Kit", "Kat" } }; Console.WriteLine(FlipTable.Of(headers, data)); } { string[] headers = { "Test", "Header" }; string[][] data = { }; Console.WriteLine(FlipTable.Of(headers, data)); } { string[] headers = { "One Two\nThree", "Four" }; string[][] data = { new[] { "Five", "Six\nSeven Eight" } }; Console.WriteLine(FlipTable.Of(headers, data)); } { string[] innerHeaders = { "One", "Two" }; string[][] innerData = { new[] { "1", "2" } }; string inner = FlipTable.Of(innerHeaders, innerData); string[] headers = { "Left", "Right" }; string[][] data = { new[] { inner, inner } }; Console.WriteLine(FlipTable.Of(headers, data)); } { var personList = new List <Person> { new Person("Junil", "Um", 37), }; personList[0].Children.Add(new Person("A", "B", 12)); Console.WriteLine(personList.FlipTablesFrom(FlipTablesPad.Right)); } { var dt = new DataTable(); dt.Columns.Add("FirstName"); dt.Columns.Add("LastName"); dt.Columns.Add("Age"); var row1 = dt.NewRow(); row1["FirstName"] = "Junil"; row1["LastName"] = "Um"; row1["Age"] = 37; dt.Rows.Add(row1); Console.WriteLine(dt.FlipTablesFrom()); } { var person2 = new Person2() { Name = new Name("Junil", null), Age = 37 }; Console.WriteLine(person2.FlipTablesFrom()); } { var person2 = new Person2() { Name = new Name("Junil", null), Age = 37 }; Console.WriteLine(person2.FlipTablesFrom(FlipTablesPad.Right)); } }
internal static string FlipTablesFromObject <T>(this T obj, FlipTablesPad pad = FlipTablesPad.Left) where T : class { return(FlipTable.Of(obj, pad)); }
public static string FlipTablesFrom(this DataSet dataSet, FlipTablesPad pad = FlipTablesPad.Left) { return(FlipTable.Of(dataSet, pad)); }
public static string FlipTablesFrom(this object obj, FlipTablesPad pad = FlipTablesPad.Left) { return(FlipTable.Of(obj, pad)); }