Skip to content

Commit

Permalink
Add the ability to provide Row Separators for tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Moaid Hathot committed Nov 25, 2023
1 parent ce14f5c commit 5c68307
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Dumpify.Playground/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

//DumpConfig.Default.Output = Outputs.Debug;

// DumpConfig.Default.TableConfig.ShowRowSeparators = true;
Console.WriteLine("---------------------");
TestSpecific();
// TestSingle();
Expand All @@ -35,9 +36,11 @@ void TestSpecific()
//}
//

var str = new { fa = "Hello", bla = "Word!" }.Dump("my label");
new { fa = "Hello", bla = "Word!" }.Dump("without separators");
new { fa = "Hello", bla = "Word!" }.Dump("with separators", tableConfig: new TableConfig { ShowRowSeparators = true });
DumpConfig.Default.UseAutoLabels = true;
DumpConfig.Default.TableConfig.ShowMemberTypes = true;
DumpConfig.Default.TableConfig.ShowRowSeparators = true;
var str2 = new { fa = "Hello", bla = "World!" }.Dump();


Expand Down
1 change: 1 addition & 0 deletions src/Dumpify/Config/TableConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ public class TableConfig
public bool NoColumnWrapping { get; set; } = false;
public bool ExpandTables { get; set; } = false;
public bool ShowMemberTypes { get; set; } = false;
public bool ShowRowSeparators { get; set; } = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ private Table CreateTable()

table.RoundedBorder();

if (_context.Config.TableConfig.ShowRowSeparators)
{
table.ShowRowSeparators();
}

return _context.Config.TableConfig.ExpandTables ? table.Expand() : table.Collapse();
}

Expand Down

0 comments on commit 5c68307

Please sign in to comment.