示例#1
0
 public MapControlAction(MapControl control, DisplayToolId id, ToolStripItem[] items)
 {
     m_Control  = control;
     m_ToolId   = id;
     m_Elements = new UserActionSupport(items);
     m_Elements.SetHandler(Do);
 }
 public MapControlAction(MapControl control, DisplayToolId id, ToolStripItem[] items)
 {
     m_Control = control;
     m_ToolId = id;
     m_Elements = new UserActionSupport(items);
     m_Elements.SetHandler(Do);
 }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 void AddAction(ToolStripItem[] items, DisplayToolId commandId)
 {
     m_Actions.Add(new MapControlAction(mapControl, commandId, items));
 }
示例#6
0
 void AddAction(DisplayToolId toolId, ToolStripItem[] items)
 {
     m_Actions.Add(new MapControlAction(mapControl, toolId, items));
 }
示例#7
0
        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;
        }
示例#8
0
        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;
        }
示例#9
0
 void AddAction(DisplayToolId toolId, ToolStripItem[] items)
 {
     m_Actions.Add(new MapControlAction(mapControl, toolId, items));
 }