Index: src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Commands/ShowNorthArrowCommand.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Commands/ShowNorthArrowCommand.cs (.../ShowNorthArrowCommand.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Commands/ShowNorthArrowCommand.cs (.../ShowNorthArrowCommand.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -5,40 +5,42 @@ { public class ShowNorthArrowCommand : MapViewCommand { - protected override void OnExecute(object[] arguments) + public override bool Checked { - - IMapTool 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 + get { return MapView != null ? MapView.MapControl.GetToolByType() : null; } } - public override bool Checked + protected override void OnExecute(object[] arguments) { - get + IMapTool 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