From f8adea054f2919c157cbf30fc0d80f1afe1c1a46 Mon Sep 17 00:00:00 2001 From: mkonicek Date: Sun, 13 Mar 2011 20:30:56 +0100 Subject: [PATCH] Object graph - tweaked column sizing a bit. --- .../Graph/Drawing/PositionedGraphNodeControl.xaml.cs | 5 ++--- .../Visualizers/Graph/ObjectGraph/ObjectGraphBuilder.cs | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml.cs b/src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml.cs index be24d03ffb..d0dd8a1f7d 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml.cs @@ -65,10 +65,9 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing public void CalculateWidthHeight() { - int maxLen = this.items.MaxOrDefault(contentNode => contentNode.Name.Length, 0); - int spaces = Math.Max((int)(maxLen * 1.8 - 3), 0); + int nameColumnMaxLen = this.items.MaxOrDefault(contentNode => contentNode.Name.Length, 0); GridView gv = listView.View as GridView; - gv.Columns[1].Width = 50 + spaces * 2.5; + gv.Columns[1].Width = Math.Min(20 + nameColumnMaxLen * 6, 260); gv.Columns[2].Width = 80; listView.Width = gv.Columns[0].Width + gv.Columns[1].Width + gv.Columns[2].Width + 10; diff --git a/src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/ObjectGraph/ObjectGraphBuilder.cs b/src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/ObjectGraph/ObjectGraphBuilder.cs index bf016d8a91..36f84e00d4 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/ObjectGraph/ObjectGraphBuilder.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/ObjectGraph/ObjectGraphBuilder.cs @@ -226,9 +226,14 @@ namespace Debugger.AddIn.Visualizers.Graph foreach (MemberInfo memberProp in shownType.GetFieldsAndNonIndexedProperties(flags)) { - // skip backing fields - if (memberProp.Name.Contains("<")) + if (memberProp.Name.Contains("<")) { + // skip backing fields continue; + } + if (memberProp.DeclaringType != shownType) { + // skip properties declared in the base type + continue; + } // ObjectGraphProperty needs an expression // to use expanded / nonexpanded (and to evaluate?)