diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2020-10-10 23:28:09 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2020-10-10 23:28:09 +0300 |
commit | d88b2dd455b3fc860730df03f65cef981e78e405 (patch) | |
tree | 1ff439838e342f6adb24c8a06c7a8ef757bc2775 /UVtools.GUI | |
parent | 27cbfc2aef9a04e4140dc694847bf5a6d0cd0bec (diff) |
Fix blank mats
Diffstat (limited to 'UVtools.GUI')
-rw-r--r-- | UVtools.GUI/FrmMain.cs | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/UVtools.GUI/FrmMain.cs b/UVtools.GUI/FrmMain.cs index bc56723..0f6cd03 100644 --- a/UVtools.GUI/FrmMain.cs +++ b/UVtools.GUI/FrmMain.cs @@ -877,11 +877,22 @@ namespace UVtools.GUI { var type = config.GetType(); tw.WriteLine($"[{type.Name}]"); - foreach (var property in type.GetProperties()) + foreach (var property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) { - tw.WriteLine($"{property.Name} = {property.GetValue(config)}"); + if (property.Name.Equals("Item")) continue; + var value = property.GetValue(config); + switch (value) + { + case null: + continue; + case IList list: + tw.WriteLine($"{property.Name} = {list.Count}"); + break; + default: + tw.WriteLine($"{property.Name} = {value}"); + break; + } } - tw.WriteLine(); } @@ -910,9 +921,21 @@ namespace UVtools.GUI { var type = config.GetType(); sb.AppendLine($"[{type.Name}]"); - foreach (var property in type.GetProperties()) + foreach (var property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) { - sb.AppendLine($"{property.Name} = {property.GetValue(config)}"); + if (property.Name.Equals("Item")) continue; + var value = property.GetValue(config); + switch (value) + { + case null: + continue; + case IList list: + sb.AppendLine($"{property.Name} = {list.Count}"); + break; + default: + sb.AppendLine($"{property.Name} = {value}"); + break; + } } sb.AppendLine(); |