From 0ffae49d3c2a1c000fb8e440e8936ecb9522a969 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sun, 14 Sep 2014 18:04:09 +0200 Subject: [PATCH] Added classes to debug output. --- Perspex/Diagnostics/Debug.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Perspex/Diagnostics/Debug.cs b/Perspex/Diagnostics/Debug.cs index cd9a08e2e2..1a612e679b 100644 --- a/Perspex/Diagnostics/Debug.cs +++ b/Perspex/Diagnostics/Debug.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Perspex.Controls; namespace Perspex.Diagnostics { @@ -17,6 +18,8 @@ namespace Perspex.Diagnostics private static void PrintVisualTree(IVisual visual, StringBuilder builder, int indent) { + Control control = visual as Control; + builder.Append(Indent(indent - 1)); if (indent > 0) @@ -24,13 +27,14 @@ namespace Perspex.Diagnostics builder.Append(" +- "); } - builder.AppendLine(visual.GetType().Name); - - PerspexObject p = visual as PerspexObject; + builder.Append(visual.GetType().Name); - if (p != null) + if (control != null) { - foreach (var value in p.GetSetValues()) + builder.Append(" "); + builder.AppendLine(control.Classes.ToString()); + + foreach (var value in control.GetSetValues()) { builder.Append(Indent(indent)); builder.Append(" | "); @@ -42,6 +46,10 @@ namespace Perspex.Diagnostics builder.AppendLine("]"); } } + else + { + builder.AppendLine(); + } foreach (var child in visual.VisualChildren) {