Beispiel #1
0
        private void  一个视图ToolStripMenuItem_Click(object sender, EventArgs e)//到上一个视图
        {
            IExtentStack pExtentStack = axMapControl1.ActiveView.ExtentStack;


            if (pExtentStack.CanUndo())
            {
                pExtentStack.Undo();                   //转到上一个视图
                后一个视图ToolStripMenuItem.Enabled = true; //此时后一个视图存在,后一个视图按钮变为可按
                if (!pExtentStack.CanUndo())
                {
                    一个视图ToolStripMenuItem.Enabled = false; //如果上一个视图不存在,则上一个视图这个按钮变为不可用。
                }
            }
            axMapControl1.ActiveView.Refresh();
        }
Beispiel #2
0
        private void unDoMenuItem_Click(object sender, EventArgs e)
        {
            IExtentStack pExtentStack = m_mapControl.ActiveView.ExtentStack;

            //判断是否可以回到前一视图,第一个视图没有前视图
            if (pExtentStack.CanUndo())
            {
                pExtentStack.Undo();
                reDoMenuItem.Enabled = true;    //后一视图按钮可以使用
                if (!pExtentStack.CanUndo())
                {
                    unDoMenuItem.Enabled = false;   //前一视图按钮不能使用
                }
            }
            m_mapControl.ActiveView.Refresh();
        }
Beispiel #3
0
        public override void Run(object sender, System.EventArgs e)
        {
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

            if (mapView == null)
            {
                return;
            }
            bool bBind = mapView.Bind(this);

            if (!bBind)
            {
                return;
            }
            DF2DApplication app = DF2DApplication.Application;

            if (app == null || app.Current2DMapControl == null)
            {
                return;
            }
            IExtentStack pExtentStack = app.Current2DMapControl.ActiveView.ExtentStack;

            if (pExtentStack.CanUndo())
            {
                pExtentStack.Undo();
            }

            app.Current2DMapControl.ActiveView.Refresh();
        }
Beispiel #4
0
        private void MapPreviousExtent()
        {
            IExtentStack pExtentStack = axMapControl1.ActiveView.ExtentStack;

            if (pExtentStack.CanUndo())
            {
                pExtentStack.Undo();
            }
        }
Beispiel #5
0
        public override void OnClick()
        {
            IActiveView  focusMap    = (IActiveView)_context.FocusMap;
            IExtentStack extentStack = focusMap.ExtentStack;

            if (extentStack.CanUndo())
            {
                extentStack.Undo();
                focusMap.Refresh();
            }
        }
Beispiel #6
0
        public bool IsValid(object caller, ICSharpCode.Core.Condition condition)
        {
            DF2DApplication app = DF2DApplication.Application;

            if (app == null || app.Current2DMapControl == null)
            {
                return(false);
            }
            IExtentStack pExtentStack = app.Current2DMapControl.ActiveView.ExtentStack;

            return(pExtentStack.CanUndo());
        }
        public void OnClick()
        {
            //Get the active view
            IActiveView pActiveView = (IActiveView)m_pHookHelper.FocusMap;

            //Get the extent stack
            IExtentStack pMapExtent = (IExtentStack)pActiveView.ExtentStack;

            //Undo the extent view
            if (pMapExtent.CanUndo())
            {
                pMapExtent.Undo();
            }
        }
Beispiel #8
0
        private void barButtonItem34_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            IExtentStack pExtentStack = null;

            pExtentStack = axMapControl1.ActiveView.ExtentStack;

            if (pExtentStack.CanUndo())

            {
                pExtentStack.Undo();
            }

            axMapControl1.Refresh();
        }
Beispiel #9
0
        private void toolpreview_Click(object sender, EventArgs e)//前一视图
        {
            IExtentStack viewStack = null;

            viewStack = axMapControl1.ActiveView.ExtentStack;
            if (viewStack.CanUndo())
            {
                viewStack.Undo();
                axMapControl1.Refresh();
                axMapControl1.MousePointer = esriControlsMousePointer.esriPointerDefault;
            }
            else
            {
                MessageBox.Show("这已是最前视图", "提示", MessageBoxButtons.OK);
            }
        }