目次
Dump
サンプルデータ。
class Team { private Guid Id { get; set; } = Guid.NewGuid(); public string Name { get; set; } public List<User> Members { get; set; } } class User { public string Name { get; set; } public int Age { get; set; } } var team = new Team { Name = "Hoge Japan", Members = new List<User>{ new User{ Name = "Tanaka", Age = 20 }, new User{ Name = "Sato", Age = 25 }, new User{ Name = "Suzuki", Age = 28 }, new User{ Name = "Shimizu", Age = 34 }, } };
description
// description : ヘッダー DateTime.Now.Dump(description: "Current date:");
出力結果。
depth
// depth : 初期表示で展開する深さ team.Dump("0", depth: 0); team.Dump("1", depth: 1); team.Dump("None");
出力結果。
toDataGrid
// toDataGrid : グリッドタブ表示 team.Dump(true);
出力結果。
exclude / include
// exclude : 指定したメンバーを除外 team.Dump(exclude: "Members"); // include : 指定したメンバー以外を除外 team.Dump(include: "Name");
複数指定したい場合はカンマ区切り。(exclude: "Members,Name"
)
出力結果。
alpha
// alpha : メンバーをアルファベット順に並び替える team.Dump(alpha: true); team.Dump(alpha: false);
出力結果。
noTotals
// noTotals : 合計を非表示 team.Dump(noTotals: true);
出力結果。
repeatHeadersAt
// repeatHeadersAt : 列ヘッダーを指定行毎に繰り返し表示(若干挙動怪しい) team.Dump(repeatHeadersAt: 1);
出力結果。
includePrivate
// includePrivate : プライベートメンバーの表示 team.Dump(includePrivate: true, exclude: "Members");
出力結果。
Util
Util.WithHeading("hoge", "Head").Dump(); Util.WithStyle("fuga", "color: blue").Dump(); Util.WithStyle("fuga", "font-family:consolas").Dump(); Util.WithStyle("piyo", "font-size: 24px; color: red; background-color: black; display: block;").Dump(); var names1 = new string[] { "Taro", "Hanako", "Jiro" }; var names2 = new string[] { "Taro", "Hanako" }; Util.Dif(names1, names2).Dump("Differences"); Util.RawHtml("<hr/>").Dump(); Util.RawHtml("<h1>Hoge</h1>").Dump(); Util.RawHtml("<h2>Hoge</h2>").Dump(); Util.RawHtml("<h3>Hoge</h3>").Dump();
出力結果。