Exemple #1
0
        public override void Run(object sender, EventArgs e)
        {
            Map2DCommandManager.Push(this);
            mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;
            bool bBind = mapView.Bind(this);

            if (!bBind)
            {
                return;
            }
            app = (DF2DApplication)this.Hook;
            if (app == null || app.Current2DMapControl == null)
            {
                return;
            }
            m_pMapControl = app.Current2DMapControl;
            m_pMap        = m_pMapControl.Map;
            m_pActiveView = m_pMapControl.ActiveView;
            if (mapView == null)
            {
                return;
            }
            else
            {
                m_arrPntLayer = new ArrayList();
                GetPointLayer();
            }
        }
Exemple #2
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

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

            if (!bBind)
            {
                return;
            }

            m_App = DF2DApplication.Application;
            if (m_App == null || m_App.Current2DMapControl == null)
            {
                return;
            }
            m_MapControl = m_App.Current2DMapControl;
            m_FocusMap   = m_App.Current2DMapControl.ActiveView.FocusMap;

            SaveEditing(m_FocusMap);
        }
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            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;
            }
            m_ActiveView = app.Current2DMapControl.ActiveView;
            m_Display    = app.Current2DMapControl.ActiveView.ScreenDisplay;
            app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow;
        }
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            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 || app.Workbench == null)
            {
                return;
            }
            app.Workbench.SetMenuEnable(false);
            app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow;
            //FrmCompoundConditionStats2D dialog = new FrmCompoundConditionStats2D();
            //dialog.SetData(LogicDataStructureManage2D.Instance.RootLogicGroups, LogicDataStructureManage2D.Instance.RootMajorClasses, null);
            //dialog.ShowDialog();
        }
Exemple #5
0
        public override void Run(object sender, EventArgs e)
        {
            mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;
            if (mapView == null)
            {
                return;
            }
            bool bBind = mapView.Bind(this);

            if (!bBind)
            {
                return;
            }
            app = (DF2DApplication)this.Hook;
            if (app == null || app.Current2DMapControl == null)
            {
                return;
            }
            m_pMapControl = app.Current2DMapControl;


            //道路检测
            PipeRoadCheck();

            WaitForm.Stop();
            FormCheckResult dlg = new FormCheckResult(dict, m_pMapControl);

            dlg.Text = this.CommandName;
            dlg.Show();
        }
Exemple #6
0
 public override void RestoreEnv()
 {
     Map2DCommandManager.Pop();
     mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;
     if (mapView == null) return;
     mapView.UnBind(this);
 }
Exemple #7
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

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

            if (!bBind)
            {
                return;
            }

            m_App = DF2DApplication.Application;
            if (m_App == null || m_App.Current2DMapControl == null)
            {
                return;
            }
            m_MapControl = m_App.Current2DMapControl;

            this.m_ActiveView    = m_MapControl.ActiveView;
            this.m_Display       = m_ActiveView.ScreenDisplay;
            this.m_pCurEditLayer = Class.Common.CurEditLayer as IFeatureLayer;
        }
Exemple #8
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            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;
            }

            if (Class.Common.CurEditLayer != null)
            {
                System.Windows.Forms.Form mainForm = (System.Windows.Forms.Form)app.Workbench;
                Form.frmLayerProperty     frm      = new Form.frmLayerProperty();
                frm.FeatureLayer = Class.Common.CurEditLayer as IFeatureLayer;
                frm.MapControl   = app.Current2DMapControl;

                if (frm.ShowDialog(mainForm) == System.Windows.Forms.DialogResult.OK)
                {
                    app.Current2DMapControl.ActiveView.Refresh();
                }
            }
        }
Exemple #9
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

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

            if (!bBind)
            {
                return;
            }

            m_App = DF2DApplication.Application;
            if (m_App == null || m_App.Current2DMapControl == null)
            {
                return;
            }
            m_pActiveView = m_App.Current2DMapControl.ActiveView;
            m_FocusMap    = m_App.Current2DMapControl.ActiveView.FocusMap;

            Class.Common.MapRefresh(m_pActiveView);

            RedoEditing(m_FocusMap);
            m_App.Workbench.UpdateMenu();
        }
Exemple #10
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.CanRedo())
            {
                pExtentStack.Redo();
            }

            app.Current2DMapControl.ActiveView.Refresh();
        }
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

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

            if (!bBind)
            {
                return;
            }

            m_App = DF2DApplication.Application;
            if (m_App == null || m_App.Current2DMapControl == null)
            {
                return;
            }

            m_MapControl              = m_App.Current2DMapControl;
            m_FocusMap                = m_MapControl.ActiveView.FocusMap;
            m_pActiveView             = (IActiveView)this.m_FocusMap;
            m_MapControl.MousePointer = esriControlsMousePointer.esriPointerCrosshair;
            m_dblTolerance            = Class.Common.ConvertPixelsToMapUnits(m_MapControl.ActiveView, 4);

            Class.Common.MapRefresh(m_pActiveView);
            m_App.Workbench.SetStatusInfo("提示:依次指定1.圆心;2.圆周上的一点。(A:绝对XY/ESC:取消/ENTER:结束)");//向状态栏传送提示信息
        }
Exemple #12
0
        public override void Init(object sender)
        {
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

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

            if (!bBind)
            {
                return;
            }

            //base.Init(sender);
            BarEditItem item = sender as BarEditItem;

            if (item.Edit is RepositoryItemComboBox)
            {
                RepositoryItemComboBox ricb = item.Edit as RepositoryItemComboBox;
                string[] scale = new string[] { "米", "千米", "英尺", "英里" };
                ricb.Items.AddRange(scale);
                //item.EditValue = ricb.Items[0];
            }
        }
Exemple #13
0
        public override void Run(object sender, EventArgs e)
        {
            mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;
            if (mapView == null)
            {
                return;
            }
            bool bBind = mapView.Bind(this);

            if (!bBind)
            {
                return;
            }
            app = (DF2DApplication)this.Hook;
            if (app == null || app.Current2DMapControl == null)
            {
                return;
            }
            m_pMapControl = app.Current2DMapControl;
            FrmStatsByRoad2D frmStatsByRoad2D = new FrmStatsByRoad2D(this.CommandName, "Road");

            if (frmStatsByRoad2D.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            DataTable dt      = frmStatsByRoad2D.DTTemp;
            DataTable dtstats = frmStatsByRoad2D.DTStats;
            FrmStatsByRoadOutput2D frmStatsByRoadOutput2D = new FrmStatsByRoadOutput2D();

            frmStatsByRoadOutput2D.SetData(dt);
            frmStatsByRoadOutput2D.SetStatsData(dtstats);
            frmStatsByRoadOutput2D.Show();
        }
Exemple #14
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

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

            if (!bBind)
            {
                return;
            }

            m_App = DF2DApplication.Application;
            if (m_App == null || m_App.Current2DMapControl == null)
            {
                return;
            }

            m_MapControl              = m_App.Current2DMapControl;
            m_FocusMap                = m_MapControl.ActiveView.FocusMap;
            m_pActiveView             = (IActiveView)this.m_FocusMap;
            m_MapControl.MousePointer = esriControlsMousePointer.esriPointerCrosshair;

            Class.Common.MapRefresh(m_pActiveView);
            m_App.Workbench.SetStatusInfo("快捷键提示:A:输入绝对XY坐标");
        }
Exemple #15
0
        public override void Run(object sender, EventArgs e)
        {
            Map2DCommandManager.Push(this);
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

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

            if (!bBind)
            {
                return;
            }
            app = DF2DApplication.Application;
            if (app == null || app.Current2DMapControl == null || app.Workbench == null)
            {
                return;
            }
            //app.Workbench.SetMenuEnable(false);
            m_ActiveView       = app.Current2DMapControl.ActiveView;
            m_Display          = app.Current2DMapControl.ActiveView.ScreenDisplay;
            pGraphicsContainer = app.Current2DMapControl.ActiveView.GraphicsContainer;
            app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow;
        }
Exemple #16
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            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;
            }


            FrmCertainLoc frmCertainLoc = new FrmCertainLoc();

            frmCertainLoc.Show();
        }
Exemple #17
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

            if (mapView == null)
            {
                return;
            }
            Layer2DTreePad wsPad = (Layer2DTreePad)UCService.GetContent(typeof(Layer2DTreePad));

            this.treelist = wsPad.TreeList;
            bool bBind = mapView.Bind(this);

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

            if (app == null || app.Current2DMapControl == null || app.Workbench == null)
            {
                return;
            }
            app.Workbench.SetMenuEnable(false);
            app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow;
            FrmMajorClass.Instance.Show();
        }
Exemple #18
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

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

            if (!bBind)
            {
                return;
            }

            m_App = DF2DApplication.Application;
            if (m_App == null || m_App.Current2DMapControl == null)
            {
                return;
            }
            m_MapControl = m_App.Current2DMapControl;

            Class.Common.CutObjects(m_MapControl);
            m_App.Workbench.UpdateMenu();
        }
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            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 || app.Workbench == null)
            {
                return;
            }
            //app.Workbench.SetMenuEnable(false);
            app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow;
            _bFinished = true;
        }
        public override void RestoreEnv()
        {
            if (this._uc != null)
            {
                this._uc.RestoreEnv();
                this._uc.Dispose();
                this._uc = null;
            }
            if (this._uPanel != null)
            {
                this._uPanel.GetControlContainer().Controls.Clear();
                this._uPanel.Close();
                this._uPanel = null;
            }
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

            if (mapView == null)
            {
                return;
            }
            DF2DApplication app = DF2DApplication.Application;

            if (app == null || app.Current2DMapControl == null || app.Workbench == null)
            {
                return;
            }
            //app.Workbench.SetMenuEnable(true);
            IGraphicsContainer gc = app.Current2DMapControl.Map as IGraphicsContainer;

            gc.DeleteAllElements();
            app.Current2DMapControl.ActiveView.Refresh();
            mapView.UnBind(this);
            WaitForm.Stop();
            Map2DCommandManager.Pop();
        }
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DCommandManager.Push(this);
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

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

            if (!bBind)
            {
                return;
            }

            m_App = DF2DApplication.Application;
            if (m_App == null || m_App.Current2DMapControl == null)
            {
                return;
            }
            m_MapControl = m_App.Current2DMapControl;
            m_MapControl.MousePointer = esriControlsMousePointer.esriPointerArrow;
            m_ActiveView         = m_MapControl.ActiveView;
            m_Display            = m_ActiveView.ScreenDisplay;
            this.m_pCurEditLayer = Class.Common.CurEditLayer as IFeatureLayer;

            if (Class.Common.System_ModifyFeature_Form == null)
            {
                Class.Common.System_ModifyFeature_Form            = new Form.frmModifyFeaturePro();
                Class.Common.System_ModifyFeature_Form.MapControl = m_MapControl;
                Class.Common.System_ModifyFeature_Form.Show();
            }
        }
Exemple #22
0
        public override void Run(object sender, EventArgs e)
        {
            mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;
            if (mapView == null)
            {
                return;
            }
            bool bBind = mapView.Bind(this);

            if (!bBind)
            {
                return;
            }
            app = (DF2DApplication)this.Hook;
            if (app == null || app.Current2DMapControl == null)
            {
                return;
            }
            m_pMapControl = app.Current2DMapControl;
            m_pActiveView = m_pMapControl.ActiveView;
            m_FocusMap    = m_pMapControl.ActiveView.FocusMap;

            /* IEnvelope pEnv = this.m_pMapControl.TrackRectangle();*/
//             IGeometry pGeo = pEnv as IGeometry;
//             this.m_pMapControl.Map.SelectByShape(pGeo, null, false);
//             this.m_pMapControl.Map.ClearSelection();
//             this.m_pMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, m_pActiveView.Extent);

//             IRectangleElement rectangleElement = new RectangleElementClass();
//             IElement pelement = (IElement)rectangleElement;
//             pelement.Geometry = pEnv;
//            pGraphicsContainer = this.m_pMapControl.ActiveView as IGraphicsContainer;
//            pGraphicsContainer.AddElement(pelement, 0);
            this.m_pMapControl.ActiveView.GraphicsContainer.DeleteAllElements();
//            IGraphicsContainerSelect graphicsContainerSelect = (IGraphicsContainerSelect)this.m_pMapControl;
//             if (graphicsContainerSelect != null)
//             {
//                IEnumElement enumElement = graphicsContainerSelect.SelectedElements;
//                if (enumElement == null) return;
//
//                 enumElement.Reset();
//
//                 IMap pMap = this.m_pMapControl.ActiveView.FocusMap;
//
//                 IElement element = enumElement.Next();
//                 if (element != null)
//                 {
//                     if (element == app.Current2DMapControl.ActiveView.GraphicsContainer.FindFrame(pMap))
//                     {
//                         System.Windows.Forms.MessageBox.Show("地图数据框不可删除", "错误");
//                     }
//                     else
//                     {
//                         this.m_pMapControl.ActiveView.GraphicsContainer.DeleteElement(element);
//                     }
//                     element = enumElement.Next();
//                 }
            this.m_pMapControl.ActiveView.Refresh();
        }
Exemple #23
0
        private void SuspendCommand()
        {
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

            if (mapView == null)
            {
                return;
            }
            mapView.UnBind(this);
        }
Exemple #24
0
 public override void RestoreEnv()
 {
     IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;
     if (mapView == null) return;
     mapView.UnBind(this);
     DF2DApplication app = DF2DApplication.Application;
     if (app == null || app.Current2DMapControl == null) return;
     app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerDefault;
     Map2DCommandManager.Pop();
 }
Exemple #25
0
 public override void Run(object sender, System.EventArgs e)
 {
     Map2DCommandManager.Push(this);
     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;
     app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerZoomIn;
 }
 public override void RestoreEnv()
 {
     Map2DCommandManager.Pop();
     mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;
     if (mapView == null)
     {
         return;
     }
     mapView.UnBind(this);
     m_pMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow;
 }
        private void UnBind()
        {
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

            if (mapView == null)
            {
                return;
            }
            mapView.UnBind(this);
            Map2DCommandManager.Pop();
        }
Exemple #28
0
 public override void Run(object sender, EventArgs e)
 {
     Map2DCommandManager.Push(this);
     mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;
     if (mapView == null) return;
     bool bBind = mapView.Bind(this);
     if (!bBind) return;
     app = (DF2DApplication)this.Hook;
     if (app == null || app.Current2DMapControl == null) return;
     m_pMapControl = app.Current2DMapControl;
     m_FocusMap = m_pMapControl.ActiveView.FocusMap;
     m_pActiveView = (IActiveView)this.m_FocusMap;
 }
 public override void RestoreEnv()
 {
     Map2DCommandManager.Pop();
     mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;
     if (mapView == null)
     {
         return;
     }
     mapControlEvents.OnMouseDown -= new IMapControlEvents2_OnMouseDownEventHandler(map2DCommand.OnMouseDown);
     mapControlEvents.OnMouseUp   -= new IMapControlEvents2_OnMouseUpEventHandler(map2DCommand.OnMouseUp);
     mapControlEvents.OnMouseMove -= new IMapControlEvents2_OnMouseMoveEventHandler(map2DCommand.OnMouseMove);
     //mapView.UnBind(this);
     m_pMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow;
 }
Exemple #30
0
        public override void RestoreEnv()
        {
            IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView;

            if (mapView == null)
            {
                return;
            }
            mapView.UnBind(this);
            DF2DApplication app = DF2DApplication.Application;

            if (app == null || app.Current2DMapControl == null)
            {
                return;
            }
            Map2DCommandManager.Pop();
        }