Index: src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Commands/ShowMapLegendCommand.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Commands/ShowMapLegendCommand.cs (.../ShowMapLegendCommand.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Commands/ShowMapLegendCommand.cs (.../ShowMapLegendCommand.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -5,40 +5,46 @@ { public class ShowMapLegendCommand : MapViewCommand { - protected override void OnExecute(object[] arguments) + public override bool Checked { - var tool = CurrentTool; - if (tool != null && tool is LayoutComponentTool) + get { - ((LayoutComponentTool)tool).Visible = !((LayoutComponentTool)tool).Visible; - MapView.MapControl.Refresh(); - } + IMapTool tool = CurrentTool; + if (tool != null && tool is LayoutComponentTool) + { + return ((LayoutComponentTool) tool).Visible; + } - base.OnExecute(arguments); + return false; + } + set + { + base.Checked = value; + } } protected override IMapTool CurrentTool { get { - if (MapView == null) return null; + if (MapView == null) + { + return null; + } return MapView.MapControl.GetToolByType(); } } - public override bool Checked + protected override void OnExecute(object[] arguments) { - get + var tool = CurrentTool; + if (tool != null && tool is LayoutComponentTool) { - IMapTool tool = CurrentTool; - if (tool != null && tool is LayoutComponentTool) - { - return ((LayoutComponentTool)tool).Visible; - } - - return false; + ((LayoutComponentTool) tool).Visible = !((LayoutComponentTool) tool).Visible; + MapView.MapControl.Refresh(); } - set { base.Checked = value; } + + base.OnExecute(arguments); } } } \ No newline at end of file