Browse Source

ObjectProperty.IsNull to distinguish properties that have null value from those that have value but haven't been expanded yet.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4286 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Martin Koníček 16 years ago
parent
commit
814cce4b1c
  1. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/NodeControl.xaml.cs
  2. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ExpandedNodes.cs
  3. 5
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedNodeProperty.cs
  4. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/NeatoProcess.cs
  5. 5
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectGraphBuilder.cs
  6. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectNode.cs
  7. 9
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectProperty.cs
  8. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/VisualizerWPFWindow.xaml.cs

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/NodeControl.xaml.cs

@ -67,7 +67,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing @@ -67,7 +67,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing
var row = new RowDefinition();
propertyGrid.RowDefinitions.Add(row);
if (!property.IsAtomic)
if (!property.IsAtomic && !property.IsNull)
{
Button btnExpandCollapse = new Button();
btnExpandCollapse.Tag = property;

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ExpandedNodes.cs

@ -25,12 +25,12 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -25,12 +25,12 @@ namespace Debugger.AddIn.Visualizers.Graph
return expandedNodes.ContainsKey(expression) && (expandedNodes[expression] == true);
}
public void Expand(string expression)
public void SetExpanded(string expression)
{
expandedNodes[expression] = true;
}
public void Collapse(string expression)
public void SetCollapsed(string expression)
{
expandedNodes[expression] = false;
}

5
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedNodeProperty.cs

@ -67,5 +67,10 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -67,5 +67,10 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// Is this property of atomic type? (int, string, etc.)
/// </summary>
public bool IsAtomic { get { return this.objectProperty.IsAtomic; } }
/// <summary>
/// Is the value of this property null?
/// </summary>
public bool IsNull { get { return this.objectProperty.IsNull; } }
}
}

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/NeatoProcess.cs

@ -73,10 +73,10 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -73,10 +73,10 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <returns>Same graph in Graphviz plain with position information added.</returns>
public string CalculatePositions(string dotGraph)
{
using (var writer = new StreamWriter(@"D:\__prog__\Graphviz\logIn.gv"))
/*using (var writer = new StreamWriter("logIn.gv"))
{
writer.Write(dotGraph);
}
}*/
neatoProcess.StandardInput.Write(dotGraph);
neatoProcess.StandardInput.Flush();

5
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectGraphBuilder.cs

@ -136,7 +136,8 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -136,7 +136,8 @@ namespace Debugger.AddIn.Visualizers.Graph
else
{
ObjectNode targetNode = null;
if (!isNull(memberExpr) && expandedNodes.IsExpanded(memberExpr.Code))
bool memberIsNull = isNull(memberExpr);
if (!memberIsNull && expandedNodes.IsExpanded(memberExpr.Code))
{
// for object members, edges are added
Value memberValue = getPermanentReference(memberExpr);
@ -153,7 +154,7 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -153,7 +154,7 @@ namespace Debugger.AddIn.Visualizers.Graph
{
targetNode = null;
}
thisNode.AddComplexProperty(memberName, "", memberExpr, targetNode);
thisNode.AddComplexProperty(memberName, "", memberExpr, targetNode, memberIsNull);
}
}

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectNode.cs

@ -103,10 +103,10 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -103,10 +103,10 @@ namespace Debugger.AddIn.Visualizers.Graph
/// <summary>
/// Adds complex property.
/// </summary>
internal void AddComplexProperty(string name, string value, Expression expression, ObjectNode targetNode)
internal void AddComplexProperty(string name, string value, Expression expression, ObjectNode targetNode, bool isNull)
{
properties.Add(new ObjectProperty
{ Name = name, Value = value, Expression = expression, IsAtomic = false, TargetNode = targetNode });
{ Name = name, Value = value, Expression = expression, IsAtomic = false, TargetNode = targetNode, IsNull = isNull });
}
}
}

9
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectProperty.cs

@ -30,14 +30,19 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -30,14 +30,19 @@ namespace Debugger.AddIn.Visualizers.Graph
/// </summary>
public Debugger.Expressions.Expression Expression { get; set; }
/// <summary>
/// Is this property of atomic type? (int, string, etc.)
/// </summary>
public bool IsAtomic { get; set; }
/// <summary>
/// Node that this property points to. Can be null. Always null if <see cref="IsAtomic"/> is true.
/// </summary>
public ObjectNode TargetNode { get; set; }
/// <summary>
/// Is this property of atomic type? (int, string, etc.)
/// Is this property value null? Only meaningful if <see cref="IsAtomic"/> is false.
/// </summary>
public bool IsAtomic { get; set; }
public bool IsNull { get; set; }
}
}

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/VisualizerWPFWindow.xaml.cs

@ -146,13 +146,13 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -146,13 +146,13 @@ namespace Debugger.AddIn.Visualizers.Graph
void node_Expanded(object sender, PositionedPropertyEventArgs e)
{
expandedNodes.Expand(e.Property.Expression.Code);
expandedNodes.SetExpanded(e.Property.Expression.Code);
refreshGraph();
}
void node_Collapsed(object sender, PositionedPropertyEventArgs e)
{
expandedNodes.Collapse(e.Property.Expression.Code);
expandedNodes.SetCollapsed(e.Property.Expression.Code);
refreshGraph();
}
}

Loading…
Cancel
Save