• 大小: 110KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-11
  • 语言: C#
  • 标签: ArcGIS  

资源简介

ArcGIS Engine+C#实例开发教程》源码

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.SystemUI;


namespace _sdnMap
{
    public partial class Form1 : Form
    {
        private ESRI.ArcGIS.Controls.IMapControl3 m_mapControl = null;
        private ESRI.ArcGIS.Controls.IPageLayoutControl2 m_pageLayoutControl = null;
        private IMapDocument pMapDocument;
        private ControlsSynchronizer m_controlsSynchronizer = null;
        //private string sMapUnits;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {
            //取得MapControl和PageLayoutControl的引用
            m_mapControl = (IMapControl3)this.axMapControl1.object;
            m_pageLayoutControl = (IPageLayoutControl2)this.axPageLayoutControl1.object;

            //初始化controls synchronization calss
            m_controlsSynchronizer = new ControlsSynchronizer(m_mapControl m_pageLayoutControl);

            //把MapControl和PageLayoutControl绑定起来(两个都指向同一个Map)然后设置MapControl为活动的Control
            m_controlsSynchronizer.BindControls(true);

            //为了在切换MapControl和PageLayoutControl视图同步,要添加framework Control
            m_controlsSynchronizer.AddframeworkControl(axToolbarControl1.object);
            m_controlsSynchronizer.AddframeworkControl(this.axTOCControl1.object);

            // 添加打开命令按钮到工具条
             OpenNewMapDocument openMapDoc = new OpenNewMapDocument(m_controlsSynchronizer);
             axToolbarControl1.AddItem(openMapDoc -1 0 false -1 esriCommandstyles.esriCommandstyleIconOnly);
            // sMapUnits = “Unknown“;

            m_tocControl = (ITOCControl2)this.axTOCControl1.object; 


        }

        /// 
        /// 新建地图命令
        /// 

        /// 
        /// 
        private void New_Click(object sender EventArgs e)
        {
            //询问是否保存当前地图
            DialogResult res = MessageBox.Show(“是否保存当前地图?“ “提示“ MessageBoxButtons.YesNo MessageBoxIcon.Question);
            if (res == DialogResult.Yes)
            {
                //如果要保存,调用另存为对话框
                ICommand command = new ControlsSaveAsDocCommandClass();
                if (m_mapControl != null)
                    command.OnCreate(m_controlsSynchronizer.MapControl.object);
                else
                    command.OnCreate(m_controlsSynchronizer.PageLayoutControl.object);

                command.onclick();
            }

            //创建新的地图实例
            IMap map = new MapClass();
            map.Name = “Map“;
            m_controlsSynchronizer.MapControl.DocumentFilename = string.Empty;
          

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      15389  2009-09-25 19:08  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\3sdnMap.cs

     文件       6065  2009-09-02 16:34  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\3sdnMap.csproj

     文件      24574  2009-09-03 10:26  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\3sdnMap.Designer.cs

     文件      21426  2009-09-03 10:26  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\3sdnMap.resx

     文件        822  2009-04-03 18:56  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\addData.bmp

     文件      61440  2009-09-25 19:06  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\bin\Release\3sdnMap.exe

     文件      58880  2009-09-25 19:06  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\bin\Release\3sdnMap.pdb

     文件       5632  2005-11-11 22:25  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\bin\Release\3sdnMap.vshost.exe

     文件      14682  2009-04-04 00:45  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\ControlsSynchronizer.cs

     文件        246  2009-04-03 18:56  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\exit.bmp

     文件       3127  2009-04-03 21:44  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\Maps.cs

     文件        396  2009-04-03 18:56  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\newFile.png

     文件       3343  2009-09-25 19:08  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\3sdnMap.csproj.FileListAbsolute.txt

     文件       1028  2009-09-25 19:06  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\3sdnMap.csproj.GenerateResource.Cache

     文件      61440  2009-09-25 19:06  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\3sdnMap.exe

     文件     125002  2009-09-02 16:34  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\ResolveAssemblyReference.cache

     文件       5120  2009-09-25 19:07  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\TempPE\Properties.Resources.Designer.cs.dll

     文件        822  2009-04-03 18:56  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\_sdnMap.addData.bmp

     文件        246  2009-04-03 18:56  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\_sdnMap.exit.bmp

     文件       9994  2009-09-25 19:06  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\_sdnMap.Form1.resources

     文件        396  2009-04-03 18:56  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\_sdnMap.newFile.png

     文件        692  2009-09-03 10:24  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\_sdnMap.openFile.png

     文件        246  2009-04-03 23:46  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\_sdnMap.OpenNewMapDocument.bmp

     文件       4818  2009-09-25 19:06  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\_sdnMap.Properties.Resources.resources

     文件        445  2009-04-03 18:56  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\_sdnMap.saveAs.png

     文件        683  2009-04-03 18:56  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\obj\Release\_sdnMap.saveFile.png

     文件        692  2009-09-03 10:24  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\openFile.png

     文件        246  2009-04-03 23:46  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\OpenNewMapDocument.bmp

     文件       5504  2009-04-03 23:44  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\OpenNewMapDocument.cs

     文件        466  2009-03-30 21:29  《ArcGIS Engine+C#实例开发教程》源码\3sdnMap\3sdnMap\Program.cs

............此处省略25个文件信息

评论

共有 条评论