⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 很好的带有编辑功能、量算功能。可在地图上进行距离、面积、角度测量
💻 CS
📖 第 1 页 / 共 5 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Reflection ;
using System.Data;

using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.CartoUI ; 
using ESRI.ArcGIS.Utility;
using ESRI.ArcGIS.ControlCommands ;
using ESRI.ArcGIS.Geodatabase ;  
using ESRI.ArcGIS.Output ; 
using ESRI.ArcGIS.DataSourcesGDB ; 

namespace AoTest
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.MainMenu m_Main;
		private System.Windows.Forms.MenuItem menuItem19;
		private System.Windows.Forms.MenuItem menuItem28;
		private System.Windows.Forms.MenuItem menuItem34;
		private System.Windows.Forms.MenuItem menuItem36;
		private System.Windows.Forms.StatusBar statusBar1;
		private System.Windows.Forms.ImageList imageList1;
		private System.Windows.Forms.ToolBar toolBar1;
		private System.Windows.Forms.MenuItem menuItem38;
		private System.Windows.Forms.ToolBarButton toolBarButton3;
		private System.Windows.Forms.ToolBarButton toolBarButton9;
		private System.Windows.Forms.ToolBarButton toolBarButton14;
		private System.Windows.Forms.ToolBarButton toolBarButton21;
		private System.Windows.Forms.ToolBarButton toolBarButton22;
		private System.Windows.Forms.ToolBarButton toolBarButton23;
		private System.Windows.Forms.MenuItem m_File;
		private System.Windows.Forms.MenuItem m_View;
		private System.Windows.Forms.MenuItem m_Theme;
		private System.Windows.Forms.MenuItem m_File_Print;
		private System.Windows.Forms.MenuItem m_File_Exit;
		private System.Windows.Forms.MenuItem m_Edit;
		private System.Windows.Forms.MenuItem m_Edit_New;
		private System.Windows.Forms.MenuItem m_Edit_Move;
		private System.Windows.Forms.MenuItem m_Edit_New_Point;
		private System.Windows.Forms.MenuItem m_Edit_New_Line;
		private System.Windows.Forms.MenuItem m_Edit_New_Area;
		private System.Windows.Forms.MenuItem m_Edit_Move_Point;
		private System.Windows.Forms.MenuItem m_Edit_Move_Line;
		private System.Windows.Forms.MenuItem m_Edit_Move_Area;
		private System.Windows.Forms.MenuItem m_Edit_Vertex;
		private System.Windows.Forms.MenuItem m_Edit_Vertex_Line;
		private System.Windows.Forms.MenuItem m_Edit_Vertex_Area;
		private System.Windows.Forms.MenuItem m_Theme_Lable;
		private System.Windows.Forms.MenuItem m_Theme_BreakClass;
		private System.Windows.Forms.MenuItem m_Theme_UniqueValue;
		private System.Windows.Forms.MenuItem m_Theme_DotDensity;
		private System.Windows.Forms.MenuItem m_View_ZoomIn;
		private System.Windows.Forms.MenuItem m_View_ZoomOut;
		private System.Windows.Forms.MenuItem m_View_Pan;
		private System.Windows.Forms.MenuItem m_View_EntireView;
		private System.Windows.Forms.MenuItem m_Tool;
		private System.Windows.Forms.MenuItem m_Tool_Length;
		private System.Windows.Forms.MenuItem m_Tool_Area;
		private System.Windows.Forms.MenuItem m_Tool_Angle;
		private System.Windows.Forms.MenuItem m_Tool_Refresh;
		private System.Windows.Forms.MenuItem m_View_Select;
		private System.Windows.Forms.MenuItem m_Theme_BarChart;
		private System.Windows.Forms.ToolBarButton toolBarPrint;
		private System.Windows.Forms.ToolBarButton toolBarExit;
		private System.Windows.Forms.ToolBarButton toolBarSelect;
		private System.Windows.Forms.ToolBarButton toolBarZoomIn;
		private System.Windows.Forms.ToolBarButton toolBarZoomOut;
		private System.Windows.Forms.ToolBarButton toolBarPan;
		private System.Windows.Forms.ToolBarButton toolBarViewEntire;
		private System.Windows.Forms.ToolBarButton toolBarLength;
		private System.Windows.Forms.ToolBarButton toolBarArea;
		private System.Windows.Forms.ToolBarButton toolBaAngle;
		private System.Windows.Forms.ToolBarButton toolBarRefresh;
		private System.Windows.Forms.ToolBarButton toolBarNewPoint;
		private System.Windows.Forms.ToolBarButton toolBarNewLine;
		private System.Windows.Forms.ToolBarButton toolBarNewArea;
		private System.Windows.Forms.ToolBarButton toolBarMove;
		private System.Windows.Forms.ToolBarButton toolBarVertex;
		private System.Windows.Forms.ContextMenu m_Move;
		private System.Windows.Forms.MenuItem m_MovePoint;
		private System.Windows.Forms.MenuItem m_MoveLine;
		private System.Windows.Forms.MenuItem m_MoveArea;
		private System.Windows.Forms.ContextMenu m_Vertex;
		private System.Windows.Forms.MenuItem menuItem1;
		private System.Windows.Forms.MenuItem menuItem2;
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.Panel panel2;
		private System.Windows.Forms.Splitter splitter1;
		private System.Windows.Forms.Splitter splitter2;
		private ESRI.ArcGIS.TOCControl.AxTOCControl axTOC1;
		private ESRI.ArcGIS.MapControl.AxMapControl mapHawk;
		private System.Windows.Forms.TabControl tabControl1;
		private System.Windows.Forms.TabPage tabMap;

		public ESRI.ArcGIS.MapControl.AxMapControl axMap1;
		private System.Windows.Forms.StatusBarPanel statusBarPanel1;
		private System.Windows.Forms.StatusBarPanel statusBarPanel2;
		private System.Windows.Forms.StatusBarPanel statusBarPanel3;
		private System.Windows.Forms.StatusBarPanel statusBarPanel4;
		private System.ComponentModel.IContainer components;

		private IAoInitialize m_AoInitialize = new AoInitializeClass();
		private int iMapAction = 0 ;
		AttributeList pForm;
		SurveyTools pTool;
		AoEditor pEditor;

		private System.Windows.Forms.MenuItem m_Delete_Point;
		private System.Windows.Forms.MenuItem m_Delete_Line;
		private System.Windows.Forms.MenuItem m_Delete_Area;
		private System.Windows.Forms.MenuItem m_Edit_Delete;
		private System.Windows.Forms.ToolBarButton toolBarDelete;
		private System.Windows.Forms.ContextMenu m_Delete;
		private System.Windows.Forms.MenuItem m_DeleteLine;
		private System.Windows.Forms.MenuItem m_DeleteArea;
		private System.Windows.Forms.MenuItem m_DeletePoint;
		public IMap pMap;
		

		public Form1()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.m_Main = new System.Windows.Forms.MainMenu();
			this.m_File = new System.Windows.Forms.MenuItem();
			this.m_File_Print = new System.Windows.Forms.MenuItem();
			this.menuItem36 = new System.Windows.Forms.MenuItem();
			this.m_File_Exit = new System.Windows.Forms.MenuItem();
			this.m_View = new System.Windows.Forms.MenuItem();
			this.m_View_Select = new System.Windows.Forms.MenuItem();
			this.menuItem38 = new System.Windows.Forms.MenuItem();
			this.m_View_ZoomIn = new System.Windows.Forms.MenuItem();
			this.m_View_ZoomOut = new System.Windows.Forms.MenuItem();
			this.m_View_Pan = new System.Windows.Forms.MenuItem();
			this.menuItem28 = new System.Windows.Forms.MenuItem();
			this.m_View_EntireView = new System.Windows.Forms.MenuItem();
			this.m_Edit = new System.Windows.Forms.MenuItem();
			this.m_Edit_New = new System.Windows.Forms.MenuItem();
			this.m_Edit_New_Point = new System.Windows.Forms.MenuItem();
			this.m_Edit_New_Line = new System.Windows.Forms.MenuItem();
			this.m_Edit_New_Area = new System.Windows.Forms.MenuItem();
			this.m_Edit_Delete = new System.Windows.Forms.MenuItem();
			this.m_Delete_Point = new System.Windows.Forms.MenuItem();
			this.m_Delete_Line = new System.Windows.Forms.MenuItem();
			this.m_Delete_Area = new System.Windows.Forms.MenuItem();
			this.m_Edit_Move = new System.Windows.Forms.MenuItem();
			this.m_Edit_Move_Point = new System.Windows.Forms.MenuItem();
			this.m_Edit_Move_Line = new System.Windows.Forms.MenuItem();
			this.m_Edit_Move_Area = new System.Windows.Forms.MenuItem();
			this.m_Edit_Vertex = new System.Windows.Forms.MenuItem();
			this.m_Edit_Vertex_Line = new System.Windows.Forms.MenuItem();
			this.m_Edit_Vertex_Area = new System.Windows.Forms.MenuItem();
			this.m_Tool = new System.Windows.Forms.MenuItem();
			this.m_Tool_Length = new System.Windows.Forms.MenuItem();
			this.m_Tool_Area = new System.Windows.Forms.MenuItem();
			this.m_Tool_Angle = new System.Windows.Forms.MenuItem();
			this.menuItem34 = new System.Windows.Forms.MenuItem();
			this.m_Tool_Refresh = new System.Windows.Forms.MenuItem();
			this.m_Theme = new System.Windows.Forms.MenuItem();
			this.m_Theme_Lable = new System.Windows.Forms.MenuItem();
			this.menuItem19 = new System.Windows.Forms.MenuItem();
			this.m_Theme_BreakClass = new System.Windows.Forms.MenuItem();
			this.m_Theme_UniqueValue = new System.Windows.Forms.MenuItem();
			this.m_Theme_DotDensity = new System.Windows.Forms.MenuItem();
			this.m_Theme_BarChart = new System.Windows.Forms.MenuItem();
			this.statusBar1 = new System.Windows.Forms.StatusBar();
			this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanel4 = new System.Windows.Forms.StatusBarPanel();
			this.imageList1 = new System.Windows.Forms.ImageList(this.components);
			this.toolBar1 = new System.Windows.Forms.ToolBar();
			this.toolBarPrint = new System.Windows.Forms.ToolBarButton();
			this.toolBarExit = new System.Windows.Forms.ToolBarButton();
			this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
			this.toolBarSelect = new System.Windows.Forms.ToolBarButton();
			this.toolBarZoomIn = new System.Windows.Forms.ToolBarButton();
			this.toolBarZoomOut = new System.Windows.Forms.ToolBarButton();
			this.toolBarPan = new System.Windows.Forms.ToolBarButton();
			this.toolBarViewEntire = new System.Windows.Forms.ToolBarButton();
			this.toolBarButton9 = new System.Windows.Forms.ToolBarButton();
			this.toolBarLength = new System.Windows.Forms.ToolBarButton();
			this.toolBarArea = new System.Windows.Forms.ToolBarButton();
			this.toolBaAngle = new System.Windows.Forms.ToolBarButton();
			this.toolBarRefresh = new System.Windows.Forms.ToolBarButton();
			this.toolBarButton14 = new System.Windows.Forms.ToolBarButton();
			this.toolBarNewPoint = new System.Windows.Forms.ToolBarButton();
			this.toolBarNewLine = new System.Windows.Forms.ToolBarButton();
			this.toolBarNewArea = new System.Windows.Forms.ToolBarButton();
			this.toolBarButton21 = new System.Windows.Forms.ToolBarButton();
			this.toolBarMove = new System.Windows.Forms.ToolBarButton();
			this.m_Move = new System.Windows.Forms.ContextMenu();
			this.m_MovePoint = new System.Windows.Forms.MenuItem();
			this.m_MoveLine = new System.Windows.Forms.MenuItem();
			this.m_MoveArea = new System.Windows.Forms.MenuItem();
			this.toolBarButton22 = new System.Windows.Forms.ToolBarButton();
			this.toolBarDelete = new System.Windows.Forms.ToolBarButton();
			this.m_Delete = new System.Windows.Forms.ContextMenu();
			this.m_DeletePoint = new System.Windows.Forms.MenuItem();
			this.m_DeleteLine = new System.Windows.Forms.MenuItem();
			this.m_DeleteArea = new System.Windows.Forms.MenuItem();
			this.toolBarButton23 = new System.Windows.Forms.ToolBarButton();
			this.toolBarVertex = new System.Windows.Forms.ToolBarButton();
			this.m_Vertex = new System.Windows.Forms.ContextMenu();
			this.menuItem1 = new System.Windows.Forms.MenuItem();
			this.menuItem2 = new System.Windows.Forms.MenuItem();
			this.panel1 = new System.Windows.Forms.Panel();
			this.axTOC1 = new ESRI.ArcGIS.TOCControl.AxTOCControl();
			this.splitter2 = new System.Windows.Forms.Splitter();
			this.panel2 = new System.Windows.Forms.Panel();
			this.mapHawk = new ESRI.ArcGIS.MapControl.AxMapControl();
			this.splitter1 = new System.Windows.Forms.Splitter();
			this.tabControl1 = new System.Windows.Forms.TabControl();
			this.tabMap = new System.Windows.Forms.TabPage();
			this.axMap1 = new ESRI.ArcGIS.MapControl.AxMapControl();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanel4)).BeginInit();
			this.panel1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.axTOC1)).BeginInit();
			this.panel2.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.mapHawk)).BeginInit();
			this.tabControl1.SuspendLayout();
			this.tabMap.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.axMap1)).BeginInit();
			this.SuspendLayout();
			// 
			// m_Main
			// 
			this.m_Main.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																				   this.m_File,
																				   this.m_View,
																				   this.m_Edit,
																				   this.m_Tool,
																				   this.m_Theme});
			// 
			// m_File
			// 
			this.m_File.Index = 0;
			this.m_File.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																				   this.m_File_Print,
																				   this.menuItem36,
																				   this.m_File_Exit});
			this.m_File.Text = "文件";
			// 
			// m_File_Print
			// 
			this.m_File_Print.Index = 0;
			this.m_File_Print.Text = "打印";
			this.m_File_Print.Click += new System.EventHandler(this.m_File_Print_Click);
			// 
			// menuItem36
			// 
			this.menuItem36.Index = 1;
			this.menuItem36.Text = "-";
			// 
			// m_File_Exit
			// 
			this.m_File_Exit.Index = 2;
			this.m_File_Exit.Text = "退出";
			this.m_File_Exit.Click += new System.EventHandler(this.m_File_Exit_Click);
			// 
			// m_View
			// 
			this.m_View.Index = 1;
			this.m_View.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																				   this.m_View_Select,
																				   this.menuItem38,
																				   this.m_View_ZoomIn,
																				   this.m_View_ZoomOut,
																				   this.m_View_Pan,
																				   this.menuItem28,
																				   this.m_View_EntireView});
			this.m_View.Text = "浏览";
			// 
			// m_View_Select
			// 
			this.m_View_Select.Index = 0;
			this.m_View_Select.Text = "选择";
			this.m_View_Select.Click += new System.EventHandler(this.m_View_Select_Click);
			// 
			// menuItem38
			// 
			this.menuItem38.Index = 1;
			this.menuItem38.Text = "-";
			// 
			// m_View_ZoomIn
			// 
			this.m_View_ZoomIn.Index = 2;
			this.m_View_ZoomIn.Text = "放大";
			this.m_View_ZoomIn.Click += new System.EventHandler(this.m_View_ZoomIn_Click);
			// 
			// m_View_ZoomOut
			// 
			this.m_View_ZoomOut.Index = 3;
			this.m_View_ZoomOut.Text = "缩小";
			this.m_View_ZoomOut.Click += new System.EventHandler(this.m_View_ZoomOut_Click);
			// 
			// m_View_Pan
			// 
			this.m_View_Pan.Index = 4;
			this.m_View_Pan.Text = "平移";
			this.m_View_Pan.Click += new System.EventHandler(this.m_View_Pan_Click);
			// 
			// menuItem28
			// 
			this.menuItem28.Index = 5;
			this.menuItem28.Text = "-";
			// 
			// m_View_EntireView
			// 
			this.m_View_EntireView.Index = 6;
			this.m_View_EntireView.Text = "全屏";
			this.m_View_EntireView.Click += new System.EventHandler(this.m_View_EntireView_Click);
			// 
			// m_Edit
			// 
			this.m_Edit.Index = 2;
			this.m_Edit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																				   this.m_Edit_New,
																				   this.m_Edit_Delete,
																				   this.m_Edit_Move,
																				   this.m_Edit_Vertex});
			this.m_Edit.Text = "编辑";
			// 
			// m_Edit_New
			// 
			this.m_Edit_New.Index = 0;
			this.m_Edit_New.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					   this.m_Edit_New_Point,
																					   this.m_Edit_New_Line,
																					   this.m_Edit_New_Area});
			this.m_Edit_New.Text = "新建";
			// 
			// m_Edit_New_Point
			// 
			this.m_Edit_New_Point.Index = 0;
			this.m_Edit_New_Point.Text = "点";
			this.m_Edit_New_Point.Click += new System.EventHandler(this.m_Edit_New_Point_Click);
			// 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -