public MapControlAction(MapControl control, DisplayToolId id, ToolStripItem[] items) { m_Control = control; m_ToolId = id; m_Elements = new UserActionSupport(items); m_Elements.SetHandler(Do); }
public bool IsEnabled(DisplayToolId id) { //if (this.MapModel.IsEmpty) if (!this.IsInitialized) { return(false); } switch (id) { case DisplayToolId.Overview: return(IsOverviewEnabled()); case DisplayToolId.ZoomIn: case DisplayToolId.ZoomOut: case DisplayToolId.ZoomRectangle: case DisplayToolId.DrawScale: case DisplayToolId.Magnify: case DisplayToolId.NewCentre: case DisplayToolId.Pan: case DisplayToolId.MapRefresh: return(true); case DisplayToolId.Previous: return(IsPreviousEnabled()); case DisplayToolId.Next: return(IsNextEnabled()); } return(false); }
public bool Do(DisplayToolId id) { EscapeCurrentTool(); switch (id) { case DisplayToolId.Overview: return(OnOverview()); case DisplayToolId.ZoomIn: return(ZoomIn()); case DisplayToolId.ZoomOut: return(ZoomOut()); case DisplayToolId.ZoomRectangle: return(ZoomRectangle()); case DisplayToolId.DrawScale: return(DrawScale()); case DisplayToolId.NewCentre: return(NewCenter()); case DisplayToolId.Pan: return(Pan()); case DisplayToolId.MapRefresh: return(MapRefresh()); case DisplayToolId.Previous: return(Previous()); case DisplayToolId.Next: return(Next()); case DisplayToolId.Magnify: return(Magnify()); } return(false); }
void AddAction(ToolStripItem[] items, DisplayToolId commandId) { m_Actions.Add(new MapControlAction(mapControl, commandId, items)); }
void AddAction(DisplayToolId toolId, ToolStripItem[] items) { m_Actions.Add(new MapControlAction(mapControl, toolId, items)); }
public bool IsEnabled(DisplayToolId id) { //if (this.MapModel.IsEmpty) if (!this.IsInitialized) return false; switch (id) { case DisplayToolId.Overview: return IsOverviewEnabled(); case DisplayToolId.ZoomIn: case DisplayToolId.ZoomOut: case DisplayToolId.ZoomRectangle: case DisplayToolId.DrawScale: case DisplayToolId.Magnify: case DisplayToolId.NewCentre: case DisplayToolId.Pan: case DisplayToolId.MapRefresh: return true; case DisplayToolId.Previous: return IsPreviousEnabled(); case DisplayToolId.Next: return IsNextEnabled(); } return false; }
public bool Do(DisplayToolId id) { EscapeCurrentTool(); switch (id) { case DisplayToolId.Overview: return OnOverview(); case DisplayToolId.ZoomIn: return ZoomIn(); case DisplayToolId.ZoomOut: return ZoomOut(); case DisplayToolId.ZoomRectangle: return ZoomRectangle(); case DisplayToolId.DrawScale: return DrawScale(); case DisplayToolId.NewCentre: return NewCenter(); case DisplayToolId.Pan: return Pan(); case DisplayToolId.MapRefresh: return MapRefresh(); case DisplayToolId.Previous: return Previous(); case DisplayToolId.Next: return Next(); case DisplayToolId.Magnify: return Magnify(); } return false; }