Permalink
Browse files

Debugger visualizers - removed unused IVisualizerCommand.CanExecute.

  • Loading branch information...
1 parent cc57dcd commit 5156aaa37e63a7e7a5ca4f1b0fe3056010574198 @mkonicek mkonicek committed May 15, 2011
View
2 src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/ExpressionVisualizerCommand.cs
@@ -23,8 +23,6 @@ public ExpressionVisualizerCommand(Expression expression)
this.Expression = expression;
}
- public abstract bool CanExecute { get; }
-
public abstract void Execute();
}
}
View
12 src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/GridVisualizerCommand.cs
@@ -41,21 +41,17 @@ public GridVisualizerCommand(Expression expression)
{
}
- public override bool CanExecute {
- get { return true; }
- }
-
public override string ToString()
{
return "Collection visualizer";
}
public override void Execute()
{
- if (this.Expression != null) {
- var gridVisualizerWindow = GridVisualizerWindow.EnsureShown();
- gridVisualizerWindow.ShownExpression = this.Expression;
- }
+ if (this.Expression == null)
+ return;
+ var gridVisualizerWindow = GridVisualizerWindow.EnsureShown();
+ gridVisualizerWindow.ShownExpression = this.Expression;
}
}
}
View
12 src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/ObjectGraphVisualizerCommand.cs
@@ -36,21 +36,17 @@ public ObjectGraphVisualizerCommand(Expression expression)
{
}
- public override bool CanExecute {
- get { return true; }
- }
-
public override string ToString()
{
return "Object graph visualizer";
}
public override void Execute()
{
- if (this.Expression != null) {
- var objectGraphWindow = ObjectGraphWindow.EnsureShown();
- objectGraphWindow.ShownExpression = this.Expression;
- }
+ if (this.Expression == null)
+ return;
+ var objectGraphWindow = ObjectGraphWindow.EnsureShown();
+ objectGraphWindow.ShownExpression = this.Expression;
}
}
}
View
19 src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/TextVisualizerCommand.cs
@@ -26,34 +26,25 @@ public IVisualizerCommand CreateVisualizerCommand(Expression expression)
}
}
- /// <summary>
- /// Description of TextVisualizerCommand.
- /// </summary>
public class TextVisualizerCommand : ExpressionVisualizerCommand
{
public TextVisualizerCommand(Expression expression)
:base(expression)
{
}
- public override bool CanExecute {
- get { return true; }
- }
-
public override string ToString()
{
return "Text 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.PlainText;
- textVisualizerWindow.ShowDialog();
- }
+ if (this.Expression == null)
+ return;
+ string expressionValue = this.Expression.Evaluate(WindowsDebugger.CurrentProcess).AsString();
+ var textVisualizerWindow = new TextVisualizerWindow(this.Expression.PrettyPrint(), expressionValue);
+ textVisualizerWindow.ShowDialog();
}
}
}
View
19 src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/XmlVisualizerCommand.cs
@@ -36,24 +36,19 @@ public XmlVisualizerCommand(Expression expression)
{
}
- public override bool CanExecute {
- get { return true; }
- }
-
public override string ToString()
{
- return "Xml visualizer";
+ 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();
- }
+ if (this.Expression == null)
+ return;
+ var textVisualizerWindow = new TextVisualizerWindow(
+ this.Expression.PrettyPrint(), this.Expression.Evaluate(WindowsDebugger.CurrentProcess).AsString());
+ textVisualizerWindow.Mode = TextVisualizerMode.Xml;
+ textVisualizerWindow.ShowDialog();
}
}
}
View
1 src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/ObjectGraph/PropertiesFirstComparer.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System;
using System.Reflection;
namespace Debugger.AddIn.Visualizers.Graph
View
5 src/Main/Base/Project/Src/Services/Debugger/Tooltips/IVisualizerCommand.cs
@@ -13,11 +13,6 @@ namespace ICSharpCode.SharpDevelop.Debugging
public interface IVisualizerCommand
{
/// <summary>
- /// Can this command execute?
- /// </summary>
- bool CanExecute { get; }
-
- /// <summary>
/// Executes this visualizer command.
/// </summary>
void Execute();

0 comments on commit 5156aaa

Please sign in to comment.