예제 #1
0
        //打开文档
        private void barBtnItemOpen_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand command = new ControlsOpenDocCommandClass();

            command.OnCreate(m_mapControl.Object);
            command.OnClick();
        }
예제 #2
0
        private void Btn_OpenMapDocument_Click(object sender, EventArgs e)
        {
            ICommand pCmd = new ControlsOpenDocCommandClass();

            pCmd.OnCreate(Ctrl_Map.Object);
            pCmd.OnClick();
        }
예제 #3
0
 private void menuOpenDoc_Click(object sender, EventArgs e)
 {
     //execute Open Document command
     ICommand command = new ControlsOpenDocCommandClass();
     command.OnCreate(m_mapControl.Object);
     command.OnClick();
 }
        //打开地图文档
        private void barButtonItem25_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand command = new ControlsOpenDocCommandClass();

            command.OnCreate(Variable.pMapFrm.mainMapControl.Object);
            command.OnClick();
        }
예제 #5
0
 private void menuOpenDoc_Click(object sender, EventArgs e)
 {
     //execute Open Document command
     ICommand command = new ControlsOpenDocCommandClass();
     command.OnCreate(m_mapControl.Object);
     command.OnClick();
 }
예제 #6
0
        // ===== Project =====
        /// <summary>
        /// 打开工程文件,*.mxd
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void iOpenProject_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand openmxd = new ControlsOpenDocCommandClass();

            openmxd.OnCreate(m_mapControl.Object);
            openmxd.OnClick();
        }
예제 #7
0
파일: MainForm.cs 프로젝트: jzChia/demo
        private void barButtonItem24_ItemClick(object sender, ItemClickEventArgs e)
        {
            ICommand command = new ControlsOpenDocCommandClass();

            command.OnCreate(axMapControl1.Object);
            command.OnClick();
        }
예제 #8
0
        /// <summary>
        /// ICommand工具加载地图文档
        /// </summary>
        /// <param name="mapControl">要加载的控件</param>
        public void ICommandLoadMxd(AxMapControl mapControl)
        {
            ICommand cmd = new ControlsOpenDocCommandClass();

            cmd.OnCreate(mapControl.Object);
            cmd.OnClick();
        }
예제 #9
0
        private void 文件ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ICommand pMxd = new ControlsOpenDocCommandClass();

            pMxd.OnCreate(axMapControl1.Object);
            pMxd.OnClick();
        }
        /// <summary>
        /// 使用ControlsOpenDocCommandClass加载地图
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnControlOpenDocCommandClass_Click(object sender, EventArgs e)
        {
            ICommand command = new ControlsOpenDocCommandClass();

            command.OnCreate(MainMapControl.Object);
            command.OnClick();
        }
        private void menuOpenDoc_Click(object sender, EventArgs e)
        {
            //execute Open Document command
            ICommand command = new ControlsOpenDocCommandClass();

            command.OnCreate(m_mapControl.Object);
            command.OnClick();
            m_blnOpenDoc     = true;
            m_blnExistingMap = false;
            cboFrame.Items.Clear();
        }
예제 #12
0
                private void Open_Click(object sender, EventArgs e)
               
        {
                        //execute Open Document command
                        ICommand command = new ControlsOpenDocCommandClass();
                        command.OnCreate(m_mapControl.Object);

                        command.OnClick();

                   
        }
예제 #13
0
        private void menuOpenDoc_Click(object sender, EventArgs e)
        {
            //execute Open Document command
            ICommand command = new ControlsOpenDocCommandClass();

            command.OnCreate(m_mapControl.Object);
            command.OnClick();
            for (int i = m_mapControl.LayerCount - 1; i >= 0; i--)
            {
                axMapControl2.AddLayer(m_mapControl.get_Layer(i));
            }
            axMapControl2.Extent = axMapControl2.FullExtent;
        }
예제 #14
0
파일: MainForm.cs 프로젝트: sishui198/SAAR
 private void menuOpenDoc_Click(object sender, EventArgs e)
 {
     try
     {
         //execute Open Document command
         ICommand command = new ControlsOpenDocCommandClass();
         command.OnCreate(m_mapControl.Object);
         command.OnClick();
         CloseAllOpenForms();
     }
     catch (Exception ex)
     {
         frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
         return;
     }
 }
 //打开地图文档
 public static void OpenFromFile(ESRI.ArcGIS.Controls.AxMapControl axMapControl)
 {
     if (axMapControl == null)
     {
         return;
     }
     try
     {
         ICommand pCommand;
         pCommand = new ControlsOpenDocCommandClass();
         pCommand.OnCreate(axMapControl.Object);
         pCommand.OnClick();
     }
     catch(Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }
예제 #16
0
 //打开地图文档
 public static void OpenFromFile(ESRI.ArcGIS.Controls.AxMapControl axMapControl)
 {
     if (axMapControl == null)
     {
         return;
     }
     try
     {
         ICommand pCommand;
         pCommand = new ControlsOpenDocCommandClass();
         pCommand.OnCreate(axMapControl.Object);
         pCommand.OnClick();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }
예제 #17
0
        //打开文件
        private void toolStripMenuItem4_Click(object sender, EventArgs e)
        {
            //打开文件
            //IMapDocument mxdMapDocument=new MapDocumentClass();
            //OpenFileDialog mxdOpenFileDialog=new OpenFileDialog();
            //mxdOpenFileDialog.Filter = "地图文档(*.mxd)|*.mxd";

            //if (mxdOpenFileDialog.ShowDialog()==DialogResult.OK)
            //{
            //    string mxdFilePath = mxdOpenFileDialog.FileName;
            //    if (axMapControl1.CheckMxFile(mxdFilePath))
            //    {
            //        axMapControl1.Map.ClearLayers();
            //        axMapControl1.LoadMxFile(mxdFilePath);
            //    }
            //}
            //axMapControl1.ActiveView.Refresh();
            ICommand command = new ControlsOpenDocCommandClass();

            command.OnCreate(mapControl.Object);
            command.OnClick();
        }
예제 #18
0
파일: Form1.cs 프로젝트: 609878415/fff12138
        private void Open_Map_Click(object sender, EventArgs e)
        {
            ICommand command = new ControlsOpenDocCommandClass();
            command.OnCreate(axMapControl1.Object);
            command.OnClick();
            //MapClass.OpenMapDoc(axMapControl1);

            toolStripComboBox2.Items.Clear();

            for (int i = 0; i < axMapControl1.LayerCount; i++)
            {
                toolStripComboBox2.Items.Add(axMapControl1.get_Layer(i).Name);
            }
        }
예제 #19
0
파일: frmMain.cs 프로젝트: lovelll/DQHP
        private void dotNetBarManager1_ItemClick(object sender, EventArgs e)
        {
            AxMapControl pAxMapControl = this.axMapControlMain;
            BaseItem item = sender as BaseItem;
            if (item == null) return;
            iFlagSelection = -1;
            switch (item.Name)
            {
                //新建工程
                case "mFileNewProject":
                case "bStandardNewProject":
                    ESRISysUI.ICommand pNewProject = new ESRICmdLib.ControlsNewDocCommandClass();
                    pNewProject.OnCreate(pAxMapControl.Object);
                    pNewProject.OnClick();
                    break;
                case "mFileOpenProject":
                case "bStandardOpenProject":
                    ESRISysUI.ICommand pOpenProject = new ControlsOpenDocCommandClass();
                    pOpenProject.OnCreate(pAxMapControl.Object);
                    pOpenProject.OnClick();
                    break;
                case "mFileSaveProject":
                case "bStandardSaveProject":
                    saveMapDocument(pAxMapControl);
                    break;
                case "mFileSaveAsProject":
                    ESRISysUI.ICommand pSaveAsProject = new ControlsSaveAsDocCommandClass();
                    pSaveAsProject.OnCreate(pAxMapControl.Object);
                    pSaveAsProject.OnClick();
                    break;
                case "mFileMapExport":
                case "bStandardMapExport":
                    ESRISysUI.ICommand pMapExport = new ESRICmdLib.ControlsExportMapCommandClass();
                    pMapExport.OnCreate(pAxMapControl.Object);
                    pMapExport.OnClick();
                    break;
                case "mFileMapPrint":
                case "bStandardPrint":
                    ESRISysUI.ICommand pMapPrint = new ESRICmdLib.ControlsPrintMapCommandClass();
                    pMapPrint.OnCreate(pAxMapControl.Object);
                    pMapPrint.OnClick();
                    break;
                case "mFileAddData":
                case "bStandardAddData":
                    ESRISysUI.ICommand pAddData = new ControlsAddDataCommandClass();
                    pAddData.OnCreate(pAxMapControl.Object);
                    pAddData.OnClick();
                    break;

                case "mFileExitSystem":
                    this.Close();
                    break;
                case "mViewLayerManagement":
                    this.barLayerManagement.Visible = (item as ButtonItem).Checked;
                    break;
                //mViewToolbox
                case "mViewToolboxStandard":
                    this.barToolboxStandard.Visible = (item as ButtonItem).Checked;
                    break;
                case "mViewToolboxMap":
                    this.barToolboxMap.Visible = (item as ButtonItem).Checked;
                    break;
                case "mViewStatusbar":
                    this.statusStripMain.Visible = (item as ButtonItem).Checked;
                    break;
                case "mEcoRedLineGeoHazards":
                    break;
                case "mEcoRedLineTerrain":
                    frmTerrain pFrmTerrain = new frmTerrain(pAxMapControl.Map);
                    pFrmTerrain.ShowDialog();
                    break;
                case "mEcoRedLineWSCons":
                    frmWaterSoilConservation pFrmWaterSoilConervation = new frmWaterSoilConservation(pAxMapControl.Map);
                    pFrmWaterSoilConervation.ShowDialog();
                    break;
                case "mEcoRedLineWCons":
                    frmWaterConervation pFrmWaterConervation = new frmWaterConervation(pAxMapControl.Map);
                    pFrmWaterConervation.ShowDialog();
                    break;
                case "mEcoRedLineFlood":
                    MessageBox.Show("正在研发!");
                    break;
                case "mEcoRedLineBiodiversity":
                    MessageBox.Show("正在研发!");
                    break;
                //预测
                case "mTrendPop":
                    frmPOP pFrmPop = new frmPOP();
                    pFrmPop.ShowDialog();
                    break;
                case "mTrendGdp":
                    frmGDP pFrmGdp = new frmGDP();
                    pFrmGdp.ShowDialog();
                    break;
                case "mTrendLand":
                    MessageBox.Show("正在研发!");
                    break;
                case "mOptDLS":
                    frmDLSSimulation pFrmDLSSimulation = new frmDLSSimulation(pAxMapControl.Map);
                    pFrmDLSSimulation.ShowDialog();
                    break;
                //空间分析
                case "mSpBuffer":
                    frmBuffer pFrmBuffer = new frmBuffer(pAxMapControl.Map);
                    pFrmBuffer.ShowDialog();
                    pFrmBuffer.Dispose();
                    break;
                case "mSpClip":
                    frmClips pFrmClip = new frmClips(pAxMapControl.Map);
                    pFrmClip.ShowDialog();
                    pFrmClip.Dispose();
                    break;
                case "mSpReClass":
                    frmRasterReClass pFrmRaterReClass = new frmRasterReClass(pAxMapControl.Map);
                    pFrmRaterReClass.ShowDialog();
                    pFrmRaterReClass.Dispose();
                    break;
                case "mSpSlope":
                    frmSlope pFrmSlope = new frmSlope(pAxMapControl.Map);
                    pFrmSlope.ShowDialog();
                    pFrmSlope.Dispose();
                    break;
                case "mSpAspect":
                    frmAspect pFrmAspect = new frmAspect(pAxMapControl.Map);
                    pFrmAspect.ShowDialog();
                    pFrmAspect.Dispose();
                    break;
                case "mSpDtFeature2Raster":
                    frmFeatureToRaster pFrmFeatureToRaster = new frmFeatureToRaster(pAxMapControl.Map);
                    pFrmFeatureToRaster.ShowDialog();
                    pFrmFeatureToRaster.Dispose();
                    break;
                case "mSpDtRaster2Feature":
                    frmRasterToFeature pFrmRasterToFeature = new frmRasterToFeature(pAxMapControl.Map);
                    pFrmRasterToFeature.ShowDialog();
                    pFrmRasterToFeature.Dispose();
                    break;
                case "mSpStatistic":
                    frmStatistic pFrmStatistic = new frmStatistic(pAxMapControl.Map);
                    pFrmStatistic.ShowDialog();
                    pFrmStatistic.Dispose();
                    break;
                case "mHelpHelp":
                    //PageLayout.frmPageLayout pageLayout = new PageLayout.frmPageLayout(this.mapControl.Object as IMapControl3);
                    //pageLayout.Owner = this;
                    //pageLayout.Show();
                    MessageBox.Show("正在研发!");
                    break;
                case "mHelpAbout":
                    frmReport p = new frmReport(pAxMapControl.Map);
                    p.ShowDialog();
                    p.Dispose();
                    //RasterSymbology.frmSymbology p = new RasterSymbology.frmSymbology(this._mapControl.ActiveView.FocusMap.get_Layer(0) as IRasterLayer, this._mapControl as IMapControl4,this._tocControl as ITOCControl2);
                    //p.ShowDialog();
                    //p.Dispose();

                    //MessageBox.Show("正在研发!");
                    break;

                //地图操作工具栏
                case "bMapZoomIn":
                    ESRISysUI.ICommand pZoomInTool = null;
                    pZoomInTool = new ControlsMapZoomInToolClass();
                    pZoomInTool.OnCreate(pAxMapControl.Object);
                    pAxMapControl.CurrentTool = pZoomInTool as ESRISysUI.ITool;
                    break;
                case "bMapZoomOut":
                    ESRISysUI.ICommand pZoomOutTool = null;
                    pZoomOutTool = new ControlsMapZoomOutToolClass();
                    pZoomOutTool.OnCreate(pAxMapControl.Object);
                    pAxMapControl.CurrentTool = pZoomOutTool as ESRISysUI.ITool;
                    break;
                case "bMapPan":
                    ESRISysUI.ICommand pPan = null;
                    pPan = new ControlsMapPanToolClass();
                    pPan.OnCreate(pAxMapControl.Object);
                    pAxMapControl.CurrentTool = pPan as ESRISysUI.ITool;
                    break;
                case "bMapFullExtent":
                    ESRISysUI.ICommand pFullExtent = null;
                    pFullExtent = new ControlsMapFullExtentCommandClass();
                    pFullExtent.OnCreate(pAxMapControl.Object);
                    pFullExtent.OnClick();
                    break;
                case "bMapFixedZoomIn":
                    ESRISysUI.ICommand pFixdZoomIn = null;
                    pFixdZoomIn = new ControlsMapZoomInFixedCommandClass();
                    pFixdZoomIn.OnCreate(pAxMapControl.Object);
                    pFixdZoomIn.OnClick();
                    break;
                case "bMapFixedZoomOut":
                    ESRISysUI.ICommand pFixedZoomOut = null;
                    pFixedZoomOut = new ControlsMapZoomOutFixedCommandClass();
                    pFixedZoomOut.OnCreate(pAxMapControl.Object);
                    pFixedZoomOut.OnClick();
                    break;
                case "bMapPreviousExtent":
                    ESRISysUI.ICommand pPreviousExtent = null;
                    pPreviousExtent = new ControlsMapZoomToLastExtentForwardCommandClass();
                    pPreviousExtent.OnCreate(pAxMapControl.Object);
                    pPreviousExtent.OnClick();
                    break;
                case "bMapNextExtent":
                    ESRISysUI.ICommand pNextExtent = null;
                    pNextExtent = new ControlsMapZoomToLastExtentBackCommandClass();
                    pNextExtent.OnCreate(pAxMapControl.Object);
                    pNextExtent.OnClick();
                    break;
                case "bMapSelection":
                    bMapSelection.ImageIndex = 14;
                    iFlagSelection = 0;
                    break;
                case "bMapSelectRectangle":
                    bMapSelection.ImageIndex = 14;
                    iFlagSelection = 1;
                    break;
                case "bMapSelectPolygon":
                    bMapSelection.ImageIndex = 15;
                    iFlagSelection = 2;
                    break;
                case "bMapSelectCircle":
                    bMapSelection.ImageIndex = 16;
                    iFlagSelection = 3;
                    break;
                case "bMapSelectLine":
                    bMapSelection.ImageIndex =17;
                    iFlagSelection = 4;
                    break;
                case "bMapSelectionClear":
                    ESRISysUI.ICommand pSelectionClear = null;
                    pSelectionClear = new ControlsClearSelectionCommandClass();
                    pSelectionClear.OnCreate(pAxMapControl.Object);
                    pSelectionClear.OnClick();
                    //IActiveView pActiveView=(IActiveView)(this.axMapControlMain.Map);
                    //pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);
                    //this.axMapControlMain.Map.ClearSelection();
                    //pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);
                    //this.axMapControlMain.CurrentTool = null;
                    break;
                case "bMapIdentify":
                    //ESRISysUI.ICommand pIdentify = null;
                    //pIdentify = new ControlsMapIdentifyToolClass();
                    //pIdentify.OnCreate(pAxMapControl.Object);
                    //pAxMapControl.CurrentTool = pIdentify as ESRISysUI.ITool;
                    CMapTool cIden = new CMapTool();
                    cIden.Identify(this.axMapControlMain);

                    break;
                case "bMapMeasure":
                    //ESRISysUI.ICommand pMeasure = null;
                    //pMeasure = new ControlsMapMeasureToolClass();
                    //pMeasure.OnCreate(pAxMapControl.Object);
                    //pAxMapControl.CurrentTool = pMeasure as ESRISysUI.ITool;
                     CMapTool cMea = new CMapTool();
                    cMea.Measure(this.axMapControlMain);
                    break;

                default:
                    //MessageBox.Show("正在研发!");
                    break;
            }
        }
예제 #20
0
        // File menu items
        void fileToolStripMenuItems_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuItem = sender as ToolStripMenuItem;
            if (menuItem == null)
                return;
            ICommand command = null;
            string itemName = menuItem.Name;
            switch (itemName)
            {
                case "newDocToolStripMenuItem":
                    command = new CreateNewDocCmd();
                    command.OnCreate(m_MapControl.Object);
                    command.OnClick();
                    break;
                case "openDocToolStripMenuItem":
                    command = new ControlsOpenDocCommandClass();
                    command.OnCreate(m_MapControl.Object);
                    command.OnClick();
                    break;
                case "saveasStripMenuItem":
                    command = new ControlsSaveAsDocCommandClass();
                    command.OnCreate(m_MapControl.Object);
                    command.OnClick();
                    break;
                case "saveDocToolStripMenuItem":
                    if (m_MapControl.CheckMxFile(m_DocmentFileName))
                    {
                        IMapDocument mapDoc = new MapDocumentClass();
                        mapDoc.Open(m_DocmentFileName, string.Empty);
                        if (!mapDoc.get_IsReadOnly(m_DocmentFileName))
                        {
                            mapDoc.ReplaceContents((IMxdContents)m_MapControl.Map);
                            mapDoc.Save(mapDoc.UsesRelativePaths, false);
                            mapDoc.Close();
                        }
                        else
                            MessageBox.Show("Cann't be save because of read-only document");
                    }
                    break;
                case "exitDocToolStripMenuItem":
                    DialogResult res = MessageBox.Show("Whether to save the current document?", "AOView", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                    if (res == DialogResult.Yes)
                    {
                        command = new ControlsSaveAsDocCommandClass();
                        command.OnCreate(axMapControl1.Object);
                        command.OnClick();
                    }
                    Application.Exit();
                    break;

                default:
                    break;
            }
        }
		private void menuOpenDoc_Click(object sender, EventArgs e)
		{
			//execute Open Document command
			ICommand command = new ControlsOpenDocCommandClass();
			command.OnCreate(m_mapControl.Object);
			command.OnClick();
			m_blnOpenDoc = true;
			m_blnExistingMap = false;
			cboFrame.Items.Clear();
		}
예제 #22
0
 //打开文档
 private void barBtnItemOpen_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     ICommand command = new ControlsOpenDocCommandClass();
     command.OnCreate(m_mapControl.Object);
     command.OnClick();
 }
예제 #23
0
 private void menuOpenDoc_Click(object sender, EventArgs e)
 {
     //execute Open Document command
     ICommand command = new ControlsOpenDocCommandClass();
     command.OnCreate(m_mapControl.Object);
     command.OnClick();
     for (int i = m_mapControl.LayerCount-1; i>=0; i--)
     {
         axMapControl2.AddLayer(m_mapControl.get_Layer(i));
     }
     axMapControl2.Extent = axMapControl2.FullExtent;
 }
예제 #24
0
파일: GMap.cs 프로젝트: truonghinh/TnX
 void IGMap.OpenMxd()
 {
     ICommand command = new ControlsOpenDocCommandClass();
     command.OnCreate(this._hook);
     command.OnClick();
 }
예제 #25
0
        private void 命令方式ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ICommand pMxd = new ControlsOpenDocCommandClass();

             pMxd.OnCreate(axMapControl1.Object);

             pMxd.OnClick();
        }