Index: src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Commands/Charting/RulerCommand.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Commands/Charting/RulerCommand.cs (.../RulerCommand.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Commands/Charting/RulerCommand.cs (.../RulerCommand.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -5,32 +5,37 @@ namespace DeltaShell.Plugins.CommonTools.Gui.Commands.Charting { - public class RulerCommand: Command, IGuiCommand + public class RulerCommand : Command, IGuiCommand { - protected override void OnExecute(params object[] arguments) + public override bool Checked { - var view = RulerTool; - if (view == null || arguments.Length == 0) + get { - return; + return RulerTool != null && RulerTool.Active; } - - RulerTool.Active = (bool) arguments[0]; } - public override bool Checked - { - get { return RulerTool != null && RulerTool.Active; } - } - public override bool Enabled { get { return Gui != null && Gui.DocumentViews.ActiveView != null && RulerTool != null; } } - + + public IGui Gui { get; set; } + + protected override void OnExecute(params object[] arguments) + { + var view = RulerTool; + if (view == null || arguments.Length == 0) + { + return; + } + + RulerTool.Active = (bool) arguments[0]; + } + private RulerTool RulerTool { get @@ -58,11 +63,9 @@ } } } - return chartView == null ? null : - chartView.GetTool() == null ? null : - chartView; + return chartView == null ? null : + chartView.GetTool() == null ? null : + chartView; } - - public IGui Gui { get; set; } } -} +} \ No newline at end of file