public override string ToString() { var props = ReflectUtil.GetAllPropertyInfoCanWritePublic(typeof(DrawConfig)); var lines = new List <string>(); foreach (var p in props) { if (p.PropertyType == typeof(BrushSet)) { continue; } var name = p.Name; object value; if (p.PropertyType == typeof(Color)) { value = ((Color)p.GetValue(this)).ToArgb(); } else { value = p.GetValue(this); } lines.Add($"{name}\t{value}"); } return(string.Join("\n", lines)); }