Browse Source
- refactored ObjectProperty - will be used in both Grid and Graph visualizers git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4318 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
17 changed files with 266 additions and 153 deletions
@ -0,0 +1,23 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace Debugger.AddIn.Visualizers.Graph |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// ObjectProperty used in ObjectGraph. Has TargetNode.
|
||||||
|
/// </summary>
|
||||||
|
public class ObjectGraphProperty : ObjectProperty |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Node that this property points to. Can be null. Always null if <see cref="IsAtomic"/> is true.
|
||||||
|
/// </summary>
|
||||||
|
public ObjectNode TargetNode { get; set; } |
||||||
|
} |
||||||
|
} |
||||||
@ -1,120 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<root> |
|
||||||
<!-- |
|
||||||
Microsoft ResX Schema |
|
||||||
|
|
||||||
Version 2.0 |
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format |
|
||||||
that is mostly human readable. The generation and parsing of the |
|
||||||
various data types are done through the TypeConverter classes |
|
||||||
associated with the data types. |
|
||||||
|
|
||||||
Example: |
|
||||||
|
|
||||||
... ado.net/XML headers & schema ... |
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
||||||
<resheader name="version">2.0</resheader> |
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
||||||
</data> |
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
||||||
<comment>This is a comment</comment> |
|
||||||
</data> |
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple |
|
||||||
name/value pairs. |
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a |
|
||||||
type or mimetype. Type corresponds to a .NET class that support |
|
||||||
text/value conversion through the TypeConverter architecture. |
|
||||||
Classes that don't support this are serialized and stored with the |
|
||||||
mimetype set. |
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the |
|
||||||
ResXResourceReader how to depersist the object. This is currently not |
|
||||||
extensible. For a given mimetype the value must be set accordingly: |
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
||||||
that the ResXResourceWriter will generate, however the reader can |
|
||||||
read any of the formats listed below. |
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64 |
|
||||||
value : The object must be serialized with |
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|
||||||
: and then encoded with base64 encoding. |
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64 |
|
||||||
value : The object must be serialized with |
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
||||||
: and then encoded with base64 encoding. |
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
||||||
value : The object must be serialized into a byte array |
|
||||||
: using a System.ComponentModel.TypeConverter |
|
||||||
: and then encoded with base64 encoding. |
|
||||||
--> |
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|
||||||
<xsd:element name="root" msdata:IsDataSet="true"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:choice maxOccurs="unbounded"> |
|
||||||
<xsd:element name="metadata"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:sequence> |
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
||||||
</xsd:sequence> |
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|
||||||
<xsd:attribute name="type" type="xsd:string" /> |
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
||||||
<xsd:attribute ref="xml:space" /> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
<xsd:element name="assembly"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:attribute name="alias" type="xsd:string" /> |
|
||||||
<xsd:attribute name="name" type="xsd:string" /> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
<xsd:element name="data"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:sequence> |
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
||||||
</xsd:sequence> |
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
||||||
<xsd:attribute ref="xml:space" /> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
<xsd:element name="resheader"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:sequence> |
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
||||||
</xsd:sequence> |
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
</xsd:choice> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
</xsd:schema> |
|
||||||
<resheader name="resmimetype"> |
|
||||||
<value>text/microsoft-resx</value> |
|
||||||
</resheader> |
|
||||||
<resheader name="version"> |
|
||||||
<value>2.0</value> |
|
||||||
</resheader> |
|
||||||
<resheader name="reader"> |
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
||||||
</resheader> |
|
||||||
<resheader name="writer"> |
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
||||||
</resheader> |
|
||||||
</root> |
|
||||||
@ -0,0 +1,40 @@ |
|||||||
|
<Window x:Class="Debugger.AddIn.Visualizers.GridVisualizer.GridVisualizerWindow" |
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||||
|
xmlns:dv="clr-namespace:Debugger.AddIn.Visualizers.Graph" |
||||||
|
Title="Grid visualizer" Height="350" Width="600"> |
||||||
|
<StackPanel> |
||||||
|
<StackPanel Orientation="Vertical" Background="AliceBlue"> |
||||||
|
|
||||||
|
<StackPanel.Resources> |
||||||
|
<Style TargetType="TextBlock"> |
||||||
|
<Setter Property="Margin" Value="0 0 8 0" /> |
||||||
|
</Style> |
||||||
|
<Style TargetType="Button"> |
||||||
|
<Setter Property="Margin" Value="8 0 0 0" /> |
||||||
|
<Setter Property="Padding" Value="8 0 8 0" /> |
||||||
|
</Style> |
||||||
|
</StackPanel.Resources> |
||||||
|
|
||||||
|
<Border Margin="3" Padding="3"> |
||||||
|
<StackPanel Orientation="Horizontal"> |
||||||
|
<TextBlock VerticalAlignment="Center">Expression:</TextBlock> |
||||||
|
<TextBox Name="txtExpression" VerticalAlignment="Center" Width="100"></TextBox> |
||||||
|
<Button>Inspect</Button> |
||||||
|
</StackPanel> |
||||||
|
</Border> |
||||||
|
|
||||||
|
<ListView Height="280" Name="listView"> |
||||||
|
<ListView.View> |
||||||
|
<GridView> |
||||||
|
</GridView> |
||||||
|
</ListView.View> |
||||||
|
</ListView> |
||||||
|
|
||||||
|
</StackPanel> |
||||||
|
|
||||||
|
<Canvas Name="canvas" Margin="4"> |
||||||
|
</Canvas> |
||||||
|
|
||||||
|
</StackPanel> |
||||||
|
</Window> |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Text; |
||||||
|
using System.Windows; |
||||||
|
using System.Windows.Controls; |
||||||
|
using System.Windows.Data; |
||||||
|
using System.Windows.Documents; |
||||||
|
using System.Windows.Input; |
||||||
|
using System.Windows.Media; |
||||||
|
|
||||||
|
namespace Debugger.AddIn.Visualizers.GridVisualizer |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for GridVisualizerWindow.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class GridVisualizerWindow : Window |
||||||
|
{ |
||||||
|
public GridVisualizerWindow() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,32 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using Debugger.AddIn.Visualizers.Utils; |
||||||
|
|
||||||
|
namespace Debugger.AddIn.Visualizers.GridVisualizer |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of ObjectValue.
|
||||||
|
/// </summary>
|
||||||
|
public class ObjectValue |
||||||
|
{ |
||||||
|
private Dictionary<string, ObjectProperty> properties = new Dictionary<string, ObjectProperty>(); |
||||||
|
|
||||||
|
public ObjectProperty this[string key] |
||||||
|
{ |
||||||
|
get |
||||||
|
{ |
||||||
|
return properties.GetValue(key); |
||||||
|
} |
||||||
|
set |
||||||
|
{ |
||||||
|
properties[key] = value; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,24 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Martin Koníèek" email="martin.konicek@gmail.com"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
using ICSharpCode.Core; |
||||||
|
using System; |
||||||
|
|
||||||
|
namespace Debugger.AddIn.Visualizers.GridVisualizer |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of ShowGridVisualizerCommand.
|
||||||
|
/// </summary>
|
||||||
|
public class ShowGridVisualizerCommand : AbstractMenuCommand |
||||||
|
{ |
||||||
|
public override void Run() |
||||||
|
{ |
||||||
|
GridVisualizerWindow window = new GridVisualizerWindow(); |
||||||
|
window.Topmost = true; |
||||||
|
window.Show(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,38 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
using System; |
||||||
|
using Debugger.Expressions; |
||||||
|
using ICSharpCode.SharpDevelop.Services; |
||||||
|
using System.Collections.Generic; |
||||||
|
|
||||||
|
namespace Debugger.AddIn.Visualizers.GridVisualizer.ValueProviders |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Provides <see cref="ObjectValue"/>s for debugee objects implementing IEnumerable.
|
||||||
|
/// </summary>
|
||||||
|
public class EnumerableValuesProvider |
||||||
|
{ |
||||||
|
private WindowsDebugger debugger; |
||||||
|
|
||||||
|
public EnumerableValuesProvider(WindowsDebugger debuggerService, Expression targetObject) |
||||||
|
{ |
||||||
|
this.debugger = debuggerService; |
||||||
|
this.itemsSource = enumerateItems(targetObject); |
||||||
|
} |
||||||
|
|
||||||
|
private IEnumerable<ObjectValue> itemsSource; |
||||||
|
public IEnumerable<ObjectValue> ItemsSource |
||||||
|
{ |
||||||
|
get { return this.itemsSource; } |
||||||
|
} |
||||||
|
|
||||||
|
private IEnumerable<ObjectValue> enumerateItems(Expression targetObject) |
||||||
|
{ |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,37 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
using System; |
||||||
|
using ICSharpCode.SharpDevelop.Services; |
||||||
|
using Debugger.Expressions; |
||||||
|
|
||||||
|
namespace Debugger.AddIn.Visualizers.GridVisualizer.ValueProviders |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Provides <see cref="ObjectValue"/>s for debugee objects implementing IList.
|
||||||
|
/// </summary>
|
||||||
|
public class ListValuesProvider |
||||||
|
{ |
||||||
|
private WindowsDebugger debugger; |
||||||
|
private Expression targetObject; |
||||||
|
|
||||||
|
public ListValuesProvider(WindowsDebugger debuggerService, Expression targetObject) |
||||||
|
{ |
||||||
|
this.debugger = debuggerService; |
||||||
|
this.targetObject = targetObject; |
||||||
|
} |
||||||
|
|
||||||
|
public int GetCount() |
||||||
|
{ |
||||||
|
return -1; |
||||||
|
} |
||||||
|
|
||||||
|
public ObjectValue GetItemAt(int index) |
||||||
|
{ |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue