Index: src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Commands/ShowMapContentsCommand.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Commands/ShowMapContentsCommand.cs (.../ShowMapContentsCommand.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Commands/ShowMapContentsCommand.cs (.../ShowMapContentsCommand.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -6,29 +6,14 @@ { public class ShowMapContentsCommand : Command, IGuiCommand { - protected override void OnExecute(params object[] arguments) + public override bool Enabled { - var sharpMapGisGuiPlugin = Gui.Plugins.OfType().FirstOrDefault(); - if (sharpMapGisGuiPlugin == null) return; - - var view = SharpMapGisGuiPlugin.Instance.MapLegendView; - var active = Gui.ToolWindowViews.Contains(view); - - if (active) + get { - Gui.ToolWindowViews.Remove(view); + return true; } - else - { - sharpMapGisGuiPlugin.InitializeMapLegend(); - } } - public override bool Enabled - { - get { return true; } - } - public override bool Checked { get @@ -43,5 +28,26 @@ } public IGui Gui { get; set; } + + protected override void OnExecute(params object[] arguments) + { + var sharpMapGisGuiPlugin = Gui.Plugins.OfType().FirstOrDefault(); + if (sharpMapGisGuiPlugin == null) + { + return; + } + + var view = SharpMapGisGuiPlugin.Instance.MapLegendView; + var active = Gui.ToolWindowViews.Contains(view); + + if (active) + { + Gui.ToolWindowViews.Remove(view); + } + else + { + sharpMapGisGuiPlugin.InitializeMapLegend(); + } + } } } \ No newline at end of file