Browse Source

Object graph visualizer shows values again - modified AtomicType.IsAtomic to work again after the reimplementation of Debugger.Core.DebugType (DebugType being derived from System.Type).

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5478 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Martin Koníček 16 years ago
parent
commit
88bf8d0085
  1. 7
      src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj
  2. 66
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/NodeControlResources.xaml
  3. 52
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PlusToggleButton.xaml
  4. 16
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml
  5. 8
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/ContentPropertyNode.cs
  6. 2
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/IListNode.cs
  7. 3
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Utils/AtomicType.cs

7
src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -354,7 +355,7 @@ @@ -354,7 +355,7 @@
</ItemGroup>
<ItemGroup>
<Page Include="Service\EditBreakpointScriptWindow.xaml" />
<Page Include="Visualizers\Graph\Drawing\PlusToggleButton.xaml" />
<Page Include="Visualizers\Graph\Drawing\NodeControlResources.xaml" />
<Page Include="Visualizers\Graph\Drawing\PositionedGraphNodeControl.xaml" />
<Page Include="Visualizers\Graph\ObjectGraphControl.xaml" />
<Page Include="Visualizers\GridVisualizer\GridVisualizerWindow.xaml" />
@ -423,4 +424,4 @@ @@ -423,4 +424,4 @@
<PropertyGroup>
<PostBuildEvent>xcopy "$(ProjectDir)Visualizers\Graph\Graphviz\*.*" "$(TargetDir)" /Y</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

66
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/NodeControlResources.xaml

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Debugger.AddIn.Visualizers"
>
<local:TooltipVisibilityConverter x:Key="toolVisConverter"></local:TooltipVisibilityConverter>
<DataTemplate x:Key="valueColumnTemplate">
<TextBlock Text="{Binding Text}" MaxWidth="200">
<TextBlock.ToolTip>
<ToolTip
DataContext="{Binding Path=PlacementTarget, RelativeSource={x:Static RelativeSource.Self}}"
Visibility="{Binding Converter={StaticResource toolVisConverter}, ConverterParameter=2}">
<TextBlock Text="{Binding Text}"></TextBlock>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate>
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="Focusable"
Value="False"/>
<Setter Property="Width"
Value="19"/>
<Setter Property="Height"
Value="13"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Width="19"
Height="13"
Background="Transparent">
<Border Width="9"
Height="9"
BorderThickness="1"
BorderBrush="#FF7898B5"
CornerRadius="1"
SnapsToDevicePixels="true">
<Border.Background>
<LinearGradientBrush StartPoint="0,0"
EndPoint="1,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="White"
Offset=".2"/>
<GradientStop Color="#FFC0B7A6"
Offset="1"/>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
<Path x:Name="ExpandPath"
Margin="1,1,1,1"
Fill="Black"
Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z"/>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked"
Value="True">
<Setter Property="Data"
TargetName="ExpandPath"
Value="M 0 2 L 0 3 L 5 3 L 5 2 Z"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

52
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PlusToggleButton.xaml

@ -1,52 +0,0 @@ @@ -1,52 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="Focusable"
Value="False"/>
<Setter Property="Width"
Value="19"/>
<Setter Property="Height"
Value="13"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Width="19"
Height="13"
Background="Transparent">
<Border Width="9"
Height="9"
BorderThickness="1"
BorderBrush="#FF7898B5"
CornerRadius="1"
SnapsToDevicePixels="true">
<Border.Background>
<LinearGradientBrush StartPoint="0,0"
EndPoint="1,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="White"
Offset=".2"/>
<GradientStop Color="#FFC0B7A6"
Offset="1"/>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
<Path x:Name="ExpandPath"
Margin="1,1,1,1"
Fill="Black"
Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z"/>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked"
Value="True">
<Setter Property="Data"
TargetName="ExpandPath"
Value="M 0 2 L 0 3 L 5 3 L 5 2 Z"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

16
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml

@ -7,21 +7,9 @@ @@ -7,21 +7,9 @@
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="PlusToggleButton.xaml" />
<ResourceDictionary Source="NodeControlResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<local:TooltipVisibilityConverter x:Key="toolVisConverter"></local:TooltipVisibilityConverter>
<DataTemplate x:Key="valueColumnTemplate">
<TextBlock Text="{Binding Text}">
<TextBlock.ToolTip>
<ToolTip
DataContext="{Binding Path=PlacementTarget, RelativeSource={x:Static RelativeSource.Self}}"
Visibility="{Binding Converter={StaticResource toolVisConverter}, ConverterParameter=2}">
<TextBlock Text="{Binding Text}"></TextBlock>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate>
</ResourceDictionary>
</UserControl.Resources>
<aero:SystemDropShadowChrome>

8
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/ContentPropertyNode.cs

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
// <version>$Revision$</version>
// </file>
using System;
using System.ComponentModel;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
@ -49,9 +50,8 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -49,9 +50,8 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{
get
{
// show expand button when appropriate
// show expand button for non-null non-atomic objects
return (!this.positionedProperty.IsAtomic && !this.positionedProperty.IsNull);
//return true;
}
}
@ -63,7 +63,9 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -63,7 +63,9 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
PropertyNode sourcePropertyNode = source as PropertyNode;
this.Name = sourcePropertyNode.Property.Name;
this.Text = sourcePropertyNode.Property.Value; // evaluated in Evaluate()
// Important to set Text here, as we might be just building new view over existing (evaluated) model.
// Evaluated also in Evaluate() if needed.
this.Text = sourcePropertyNode.Property.Value;
this.IsNested = false;
this.IsExpanded = false; // always false, property content nodes are never expanded
this.positionedProperty = new PositionedNodeProperty(

2
src/AddIns/Debugger/Debugger.AddIn/Visualizers/IListNode.cs

@ -29,6 +29,6 @@ namespace Debugger.AddIn.TreeModel @@ -29,6 +29,6 @@ namespace Debugger.AddIn.TreeModel
public override bool HasChildNodes {
get { return this.count > 0; }
}
}
}
}

3
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Utils/AtomicType.cs

@ -23,7 +23,8 @@ namespace Debugger.AddIn.Visualizers.Utils @@ -23,7 +23,8 @@ namespace Debugger.AddIn.Visualizers.Utils
/// <returns>True if expression's type is atomic, False otherwise.</returns>
public static bool IsAtomic(this DebugType type)
{
return !(type.IsClass || type.IsValueType /* = struct in C# */);
// class is complex, String has IsClass == true but we want to treat it like atomic
return !type.IsClass || type.FullName == "System.String";
}
/// <summary>

Loading…
Cancel
Save