Browse Source

Commit of minor changes before big refactoring.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4360 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Martin Koníček 17 years ago
parent
commit
ce6c51af7d
  1. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/GraphMatcher.cs
  2. 11
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedNodeProperty.cs
  3. 9
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectGraphBuilder.cs
  4. 27
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectNode.cs
  5. 3
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/VisualizerWPFWindow.xaml.cs
  6. 5
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/GridVisualizer/LazyListView.cs
  7. 1
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/GridVisualizer/ObjectValue.cs
  8. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/GridVisualizer/ValueProviders/VirtualizingCollection.cs
  9. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/GridVisualizer/ValueProviders/VirtualizingIEnumerable.cs

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/GraphMatcher.cs

@ -94,7 +94,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -94,7 +94,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
private bool isSameAddress(PositionedNode node1, PositionedNode node2)
{
return node1.ObjectNode.DebuggerValue.GetObjectAddress() == node2.ObjectNode.DebuggerValue.GetObjectAddress();
return node1.ObjectNode.PermanentReference.GetObjectAddress() == node2.ObjectNode.PermanentReference.GetObjectAddress();
}
}
}

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

@ -25,6 +25,12 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -25,6 +25,12 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
public bool IsExpanded { get; set; }
/// <summary>
/// Edge outgoing from this property to another <see cref="PositionedNode"/>.
/// </summary>
public PositionedEdge Edge { get; set; }
private ObjectGraphProperty objectProperty;
/// <summary>
/// Underlying <see cref="ObjectProperty"/>.
@ -43,11 +49,6 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -43,11 +49,6 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
get { return this.containingNode; }
}
/// <summary>
/// Edge outgoing from this property to another <see cref="PositionedNode"/>.
/// </summary>
public PositionedEdge Edge { get; set; }
/// <summary>
/// e.g. "Age"
/// </summary>

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

@ -141,7 +141,7 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -141,7 +141,7 @@ namespace Debugger.AddIn.Visualizers.Graph
private void loadNodeProperties(ObjectNode thisNode)
{
// take all properties for this value (type = value's real type)
foreach(Expression memberExpr in thisNode.DebuggerValue.Expression.AppendObjectMembers(thisNode.DebuggerValue.Type, _bindingFlags))
foreach(Expression memberExpr in thisNode.PermanentReference.Expression.AppendObjectMembers(thisNode.PermanentReference.Type, _bindingFlags))
{
checkIsOfSupportedType(memberExpr);
@ -210,7 +210,7 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -210,7 +210,7 @@ namespace Debugger.AddIn.Visualizers.Graph
// permanent reference to the object this node represents is useful for graph building,
// and matching nodes in animations
newNode.DebuggerValue = permanentReference;
newNode.PermanentReference = permanentReference;
return newNode;
}
@ -235,7 +235,7 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -235,7 +235,7 @@ namespace Debugger.AddIn.Visualizers.Graph
// (hash codes are not uniqe - http://stackoverflow.com/questions/750947/-net-unique-object-identifier)
ulong objectAddress = value.GetObjectAddress();
ObjectNode nodeWithSameAddress = nodesWithSameHashCode.Find(
node => { return node.DebuggerValue.GetObjectAddress() == objectAddress; } );
node => { return node.PermanentReference.GetObjectAddress() == objectAddress; } );
return nodeWithSameAddress;
}
}
@ -280,7 +280,8 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -280,7 +280,8 @@ namespace Debugger.AddIn.Visualizers.Graph
private bool isOfAtomicType(Expression expr)
{
DebugType typeOfValue = expr.Evaluate(debuggerService.DebuggedProcess).Type;
return (!typeOfValue.IsClass) || typeOfValue.IsString;
return !(typeOfValue.IsClass || typeOfValue.IsValueType);
//return (!typeOfValue.IsClass) || typeOfValue.IsString;
}
#region Expression helpers

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

@ -19,7 +19,7 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -19,7 +19,7 @@ namespace Debugger.AddIn.Visualizers.Graph
/// <summary>
/// Permanent reference to the value in the the debugee this node represents.
/// </summary>
internal Debugger.Value DebuggerValue { get; set; }
internal Debugger.Value PermanentReference { get; set; } // needed for graph building and matching, since hashCodes are not unique
/// <summary>
/// Hash code in the debuggee of the DebuggerValue this node represents.
/// </summary>
@ -27,34 +27,17 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -27,34 +27,17 @@ namespace Debugger.AddIn.Visualizers.Graph
/// <summary>
/// Expression used to obtain this node.
/// </summary>
public Expressions.Expression Expression { get { return this.DebuggerValue.Expression; } }
/*private List<ObjectEdge> _edges = new List<ObjectEdge>();
/// <summary>
/// Outgoing edges.
/// </summary>
public IEnumerable<ObjectEdge> Edges
{
get { return _edges; }
}
/// <summary>
/// Adds outgoing edge.
/// </summary>
internal void AddNamedEdge(ObjectNode targetNode, string edgeName)
{
_edges.Add(new ObjectEdge { Name = edgeName, SourceNode = this, TargetNode = targetNode });
}*/
public Expressions.Expression Expression { get { return this.PermanentReference.Expression; } }
class PropertyComparer : IComparer<ObjectGraphProperty>
{
public int Compare(ObjectGraphProperty prop1, ObjectGraphProperty prop2)
{
// order by IsAtomic, Name
int atomic = prop2.IsAtomic.CompareTo(prop1.IsAtomic);
if (atomic != 0)
int comparedAtomic = prop2.IsAtomic.CompareTo(prop1.IsAtomic);
if (comparedAtomic != 0)
{
return atomic;
return comparedAtomic;
}
else
{

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

@ -151,7 +151,8 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -151,7 +151,8 @@ namespace Debugger.AddIn.Visualizers.Graph
// remember this property is expanded (for later graph rebuilds)
expandedNodes.SetExpanded(e.Property.Expression.Code);
// add edge (+ possibly node) to underlying object graph (no need to rebuild)
// add edge (+ possibly nodes) to underlying object graph (no need to rebuild)
// TODO can add more nodes if they are expanded - now this adds always one node
e.Property.ObjectProperty.TargetNode = this.objectGraphBuilder.ObtainNodeForExpression(e.Property.Expression);
layoutGraph(this.objectGraph);
}

5
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/GridVisualizer/LazyListView.cs

@ -9,7 +9,10 @@ using System.Windows.Controls; @@ -9,7 +9,10 @@ using System.Windows.Controls;
namespace Debugger.AddIn.Visualizers.GridVisualizer
{
/// <summary>
/// ListView that takes VirtualizingIEnumerable as source,
/// and requests additional items from the source as needed when scrolling.
/// </summary>
public class LazyListView<T>
{
private ListView listView;

1
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/GridVisualizer/ObjectValue.cs

@ -44,6 +44,7 @@ namespace Debugger.AddIn.Visualizers.GridVisualizer @@ -44,6 +44,7 @@ namespace Debugger.AddIn.Visualizers.GridVisualizer
property.IsAtomic = memberValue.Type.IsPrimitive;
property.IsNull = memberValue.IsNull;
property.Value = memberValue.AsString;
//property.Value = memberValue.InvokeToString(); // TODO commit this in next commit of Grid - use debugee defined ToString()
result.properties.Add(property.Name, property);
}

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/GridVisualizer/ValueProviders/VirtualizingCollection.cs

@ -11,7 +11,7 @@ using System.Collections.Generic; @@ -11,7 +11,7 @@ using System.Collections.Generic;
namespace Debugger.AddIn.Visualizers.GridVisualizer
{
/// <summary>
/// IList&lt;T&gt; with data vitualization - the indexer is lazy, uses IListValuesProvider to obtain values.
/// IList&lt;T&gt; with data vitualization - the indexer is lazy, uses IListValuesProvider to obtain values when needed.
/// </summary>
public class VirtualizingCollection<T> : IList<T>, IList
{

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/GridVisualizer/ValueProviders/VirtualizingIEnumerable.cs

@ -10,7 +10,11 @@ using System.Collections.ObjectModel; @@ -10,7 +10,11 @@ using System.Collections.ObjectModel;
namespace Debugger.AddIn.Visualizers.GridVisualizer
{
/// <summary>
/// A wrapper around IEnumerable&lt;T&gt; with RequestNextItems method for pulling additional items
/// from the IEnumerable&lt;T&gt; when needed.
/// Can be used as source for LazyListView.
/// </summary>
public class VirtualizingIEnumerable<T> : ObservableCollection<T>
{
private IEnumerator<T> originalSourceEnumerator;

Loading…
Cancel
Save