Browse Source
Text visualizer uses AvalonEdit. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4841 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
10 changed files with 123 additions and 21 deletions
@ -0,0 +1,62 @@ |
|||||||
|
// <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 Debugger.MetaData; |
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using Debugger.AddIn.TreeModel; |
||||||
|
using Debugger.AddIn.Visualizers.TextVisualizer; |
||||||
|
using ICSharpCode.NRefactory.Ast; |
||||||
|
using ICSharpCode.SharpDevelop.Debugging; |
||||||
|
using ICSharpCode.SharpDevelop.Services; |
||||||
|
|
||||||
|
namespace Debugger.AddIn.Visualizers |
||||||
|
{ |
||||||
|
public class XmlVisualizerDescriptor : IVisualizerDescriptor |
||||||
|
{ |
||||||
|
public bool IsVisualizerAvailable(DebugType type) |
||||||
|
{ |
||||||
|
return type.IsString; |
||||||
|
} |
||||||
|
|
||||||
|
public IVisualizerCommand CreateVisualizerCommand(Expression expression) |
||||||
|
{ |
||||||
|
return new XmlVisualizerCommand(expression); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Description of TextVisualizerCommand.
|
||||||
|
/// </summary>
|
||||||
|
public class XmlVisualizerCommand : ExpressionVisualizerCommand |
||||||
|
{ |
||||||
|
public XmlVisualizerCommand(Expression expression) |
||||||
|
:base(expression) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public override bool CanExecute { |
||||||
|
get { return true; } |
||||||
|
} |
||||||
|
|
||||||
|
public override string ToString() |
||||||
|
{ |
||||||
|
return "Xml visualizer"; |
||||||
|
} |
||||||
|
|
||||||
|
public override void Execute() |
||||||
|
{ |
||||||
|
if (this.Expression != null) |
||||||
|
{ |
||||||
|
var textVisualizerWindow = new TextVisualizerWindow( |
||||||
|
this.Expression.PrettyPrint(), this.Expression.Evaluate(WindowsDebugger.CurrentProcess).InvokeToString()); |
||||||
|
textVisualizerWindow.Mode = TextVisualizerMode.Xml; |
||||||
|
textVisualizerWindow.ShowDialog(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
// <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.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System; |
||||||
|
|
||||||
|
public enum TextVisualizerMode |
||||||
|
{ |
||||||
|
PlainText, |
||||||
|
Xml |
||||||
|
} |
||||||
Loading…
Reference in new issue