Index: src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Commands/Charting/ShowChartLegendViewCommand.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Commands/Charting/ShowChartLegendViewCommand.cs (.../ShowChartLegendViewCommand.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Commands/Charting/ShowChartLegendViewCommand.cs (.../ShowChartLegendViewCommand.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -6,24 +6,6 @@ { public class ShowChartLegendViewCommand : Command, IGuiCommand { - protected override void OnExecute(params object[] arguments) - { - var commonToolsGuiPlugin = Gui.Plugins.OfType().FirstOrDefault(); - if (commonToolsGuiPlugin == null) return; - - var view = CommonToolsGuiPlugin.ChartLegendView; - var active = Gui.ToolWindowViews.Contains(view); - - if (active) - { - Gui.ToolWindowViews.Remove(view); - } - else - { - commonToolsGuiPlugin.InitializeChartLegendView(); - } - } - public override bool Checked { get @@ -39,9 +21,33 @@ public override bool Enabled { - get { return true; } + get + { + return true; + } } public IGui Gui { get; set; } + + protected override void OnExecute(params object[] arguments) + { + var commonToolsGuiPlugin = Gui.Plugins.OfType().FirstOrDefault(); + if (commonToolsGuiPlugin == null) + { + return; + } + + var view = CommonToolsGuiPlugin.ChartLegendView; + var active = Gui.ToolWindowViews.Contains(view); + + if (active) + { + Gui.ToolWindowViews.Remove(view); + } + else + { + commonToolsGuiPlugin.InitializeChartLegendView(); + } + } } } \ No newline at end of file