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

资源简介

编译修改的ArcGIS+Engine+C#实例,内含源码,doc。适合新人学习。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
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 _3sdnMap
{
    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;
        //TOCControl控件变量
        private ITOCControl2 m_tocControl = null;
        //TOCControl中Map菜单
        private IToolbarMenu m_menuMap = null;
        //TOCControl中图层菜单
        private IToolbarMenu m_menulayer = null;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {
            sMapUnits = “Unknown“;
            //在Form1_Load函数进行初始化,即菜单的创建:
            m_menuMap = new ToolbarMenuClass();
            m_menulayer = new ToolbarMenuClass();

            // 取得 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);

            //添加自定义菜单项到TOCCOntrol的Map菜单中
            //打开文档菜单
            m_menuMap.AddItem(new OpenNewMapDocument(m_controlsSynchronizer) -1 0 false esriCommandstyles.esriCommandstyleIconAndText);
            //添加数据菜单
            m_menuMap.AddItem(new ControlsAddDataCommandClass() -1 1 false esriCommandstyles.esriCommandstyleIconAndText);
            //打开全部图层菜单
            m_menuMap.AddItem(new layerVisibility() 1 2 false esriCommandstyles.esriCommandstyleTextOnly);
            //关闭全部图层菜单
            m_menuMap.AddItem(new layerVisibility() 2 3 false esriCommandstyles.esriCommandstyleTextOnly);
            //以二级菜单的形式添加内置的“选择”菜单
            m_menuMap.AddSubMenu(“esr

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

     文件      21828  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\3sdnMap.cs

     文件       7516  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\3sdnMap.csproj

     文件      23189  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\3sdnMap.Designer.cs

     文件      19942  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\3sdnMap.resx

     文件       8423  2011-04-14 14:52  3sdnMap\3sdnMap\3sdnMap\AttributeTableFrm.cs

     文件       2409  2011-04-14 14:52  3sdnMap\3sdnMap\3sdnMap\AttributeTableFrm.Designer.cs

     文件       5814  2011-04-14 14:52  3sdnMap\3sdnMap\3sdnMap\AttributeTableFrm.resx

     文件      65024  2011-04-15 11:05  3sdnMap\3sdnMap\3sdnMap\bin\Debug\3sdnMap.exe

     文件     114176  2011-04-15 11:05  3sdnMap\3sdnMap\3sdnMap\bin\Debug\3sdnMap.pdb

     文件      14328  2011-04-15 11:17  3sdnMap\3sdnMap\3sdnMap\bin\Debug\3sdnMap.vshost.exe

     文件      14566  2011-04-14 13:43  3sdnMap\3sdnMap\3sdnMap\ControlsSynchronizer.cs

     文件        246  2011-04-14 14:57  3sdnMap\3sdnMap\3sdnMap\LabellayerCmd.bmp

     文件       4808  2011-04-14 14:59  3sdnMap\3sdnMap\3sdnMap\LabellayerCmd.cs

     文件       3609  2011-04-14 15:03  3sdnMap\3sdnMap\3sdnMap\LabellayerFrm.cs

     文件       5118  2011-04-14 14:58  3sdnMap\3sdnMap\3sdnMap\LabellayerFrm.Designer.cs

     文件       6519  2011-04-14 14:58  3sdnMap\3sdnMap\3sdnMap\LabellayerFrm.resx

     文件       2471  2011-04-14 14:13  3sdnMap\3sdnMap\3sdnMap\layerVisibility.cs

     文件       3133  2011-04-14 13:44  3sdnMap\3sdnMap\3sdnMap\Maps.cs

     文件       1301  2011-04-15 11:17  3sdnMap\3sdnMap\3sdnMap\obj\Debug\3sdnMap.csproj.FileListAbsolute.txt

     文件       1055  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\obj\Debug\3sdnMap.csproj.GenerateResource.Cache

     文件      65024  2011-04-15 11:05  3sdnMap\3sdnMap\3sdnMap\obj\Debug\3sdnMap.exe

     文件     114176  2011-04-15 11:05  3sdnMap\3sdnMap\3sdnMap\obj\Debug\3sdnMap.pdb

     文件     125091  2011-04-14 13:42  3sdnMap\3sdnMap\3sdnMap\obj\Debug\ResolveAssemblyReference.cache

     文件       4608  2011-04-15 10:56  3sdnMap\3sdnMap\3sdnMap\obj\Debug\TempPE\Resource1.Designer.cs.dll

     文件        180  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\obj\Debug\_3sdnMap.AttributeTableFrm.resources

     文件       9253  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\obj\Debug\_3sdnMap.Form1.resources

     文件        739  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\obj\Debug\_3sdnMap.LabellayerFrm.resources

     文件        180  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\obj\Debug\_3sdnMap.Properties.Resources.resources

     文件        739  2011-04-15 11:01  3sdnMap\3sdnMap\3sdnMap\obj\Debug\_3sdnMap.SymbolSelectorFrm.resources

     文件        246  2011-04-14 14:49  3sdnMap\3sdnMap\3sdnMap\OpenAttributeTable.bmp

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

评论

共有 条评论

相关资源