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

📄 mainform.cs

📁 实现SHP
💻 CS
📖 第 1 页 / 共 4 页
字号:
///GeoCon, free tool to create gml & svg from gis files. 
///Copyright(C) 2005 Amri Rosyada
///Distributed under GNU-LGPL, see a copy of the license in root directory

using System;
using System.IO;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Diagnostics; 
using System.Xml;
using System.Xml.Serialization;
using System.Threading; 

using GeoCon.Data;
using GeoCon.util;
using GeoCon.Classification;

namespace GeoCon
{
	/// <summary>
	/// Summary description for MainForm.
	/// </summary>
	/// 

	public class MainForm : System.Windows.Forms.Form
	{
		//TODO : add options to choose XSD DataType and facets for each field.
		//TODO : add messages to notify what files generated and where.
		//TODO : check SRS specification - and modify srs property properly
		//TODO : projection, projection, projection.

		/// <summary>
		/// Gets and sets the form where map preview will be drawn. 
		/// It's almost WYSIWYG to the svg output.
		/// </summary>
		public ViewForm vForm=new ViewForm();
		public FilterForm fForm;
		private Data.MapDataCollection maps;
		private DataView tableDataview;
		private DataTable infoDatatable;

		#region private components declarations
		private System.Windows.Forms.DataGrid dgLayers;
		private System.Windows.Forms.DataGrid dgTable;
		private System.Windows.Forms.ProgressBar progressBar1;
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.MainMenu mainMenu1;
		private System.Windows.Forms.MenuItem menuItem6;
		private System.Windows.Forms.MenuItem menuHelpAbout;
		private System.Windows.Forms.MenuItem menuFileExit;
		private System.Windows.Forms.MenuItem menuFileExport;
		private System.Windows.Forms.MenuItem menuFileAdd;
		private System.Windows.Forms.MenuItem menuExportGML;
		private System.Windows.Forms.MenuItem menuExportSVG;
		private System.Windows.Forms.MenuItem menuHelpContent;
		private System.Windows.Forms.MenuItem menuFilePreview;
		private System.Windows.Forms.MenuItem menuLayerMoveTop;
		private System.Windows.Forms.MenuItem menuLayerMoveUp;
		private System.Windows.Forms.MenuItem menuLayerMoveDown;
		private System.Windows.Forms.MenuItem menuLayerMoveBottom;
		private System.Windows.Forms.MenuItem menuLayerRemove;
		private System.Windows.Forms.MenuItem menuLayerRemoveSelected;
		private System.Windows.Forms.MenuItem menuLayerRemoveAll;
		private System.Windows.Forms.MenuItem menuFile;
		private System.Windows.Forms.MenuItem menuExportShape;
		private System.Windows.Forms.MenuItem menuExportMif;
		private System.Windows.Forms.MenuItem menuExportDxf;
		private System.Windows.Forms.MenuItem menuLayer;
		private System.Windows.Forms.MenuItem menuLayerMove;
		private System.Windows.Forms.MenuItem menuField;
		private System.Windows.Forms.MenuItem menuFieldSelect;
		private System.Windows.Forms.MenuItem menuFieldSelectAll;
		private System.Windows.Forms.MenuItem menuFieldSelectInvert;
		private System.Windows.Forms.MenuItem menuFieldSelectNone;
		private System.Windows.Forms.MenuItem menuHelp;
		private System.Windows.Forms.MenuItem menuRefreshTable;
		private System.Windows.Forms.MenuItem menuTable;
		private System.Windows.Forms.ToolBar toolBar1;
		private System.Windows.Forms.Panel panel3;
		private System.Windows.Forms.TabControl tabControl1;
		private System.Windows.Forms.TabPage tabFields;
		private System.Windows.Forms.DataGrid dgFields;
		private System.Windows.Forms.TabPage tabClassification;
		private System.Windows.Forms.DataGrid dgBins;
		private System.Windows.Forms.Panel panel2;
		private System.Windows.Forms.Button buttonClassApply;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.ComboBox comboClassCount;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.ComboBox comboClassField;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.ComboBox comboClassType;
		private System.Windows.Forms.TabPage tabTable;
		private System.Windows.Forms.Label labelgenerating;
		private System.Windows.Forms.TabPage tabInfo;
		private System.Windows.Forms.Splitter splitter1;

		private System.Windows.Forms.ImageList imageList1;
		private System.Windows.Forms.ToolBarButton buttonExit;
		private System.Windows.Forms.ToolBarButton buttonAdd;
		private System.Windows.Forms.ToolBarButton buttonRemove;
		private System.Windows.Forms.ToolBarButton buttonTop;
		private System.Windows.Forms.ToolBarButton buttonUp;
		private System.Windows.Forms.ToolBarButton buttonDown;
		private System.Windows.Forms.ToolBarButton buttonBottom;
		private System.Windows.Forms.ToolBarButton buttonTable;
		private System.Windows.Forms.ToolBarButton buttonView;
		private System.Windows.Forms.ToolBarButton buttonToSVG;
		private System.Windows.Forms.ToolBarButton buttonToGML;
		private System.Windows.Forms.MenuItem menuItem2;
		private System.Windows.Forms.MenuItem menuItem3;
		private System.Windows.Forms.MenuItem menuItem4;
		private System.Windows.Forms.MenuItem menuItem5;
		private System.Windows.Forms.MenuItem menuItem7;
		private System.Windows.Forms.ToolBarButton buttonAbout;
		private System.Windows.Forms.DataGrid dgInfo;
		private System.Windows.Forms.MenuItem menuTableFilter;
		private System.Windows.Forms.CheckBox checkBoxShowNull;
		private System.Windows.Forms.ToolBarButton buttonFilter;
		private System.Windows.Forms.ToolBarButton separator1;
		private System.Windows.Forms.ToolBarButton separator2;
		private System.ComponentModel.IContainer components;
		#endregion

		#region disposable member
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		#endregion

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
			this.progressBar1 = new System.Windows.Forms.ProgressBar();
			this.panel1 = new System.Windows.Forms.Panel();
			this.label1 = new System.Windows.Forms.Label();
			this.mainMenu1 = new System.Windows.Forms.MainMenu();
			this.menuFile = new System.Windows.Forms.MenuItem();
			this.menuFileAdd = new System.Windows.Forms.MenuItem();
			this.menuFilePreview = new System.Windows.Forms.MenuItem();
			this.menuFileExport = new System.Windows.Forms.MenuItem();
			this.menuExportGML = new System.Windows.Forms.MenuItem();
			this.menuExportSVG = new System.Windows.Forms.MenuItem();
			this.menuItem7 = new System.Windows.Forms.MenuItem();
			this.menuItem5 = new System.Windows.Forms.MenuItem();
			this.menuExportShape = new System.Windows.Forms.MenuItem();
			this.menuExportMif = new System.Windows.Forms.MenuItem();
			this.menuItem4 = new System.Windows.Forms.MenuItem();
			this.menuExportDxf = new System.Windows.Forms.MenuItem();
			this.menuItem6 = new System.Windows.Forms.MenuItem();
			this.menuFileExit = new System.Windows.Forms.MenuItem();
			this.menuLayer = new System.Windows.Forms.MenuItem();
			this.menuLayerMove = new System.Windows.Forms.MenuItem();
			this.menuLayerMoveTop = new System.Windows.Forms.MenuItem();
			this.menuLayerMoveUp = new System.Windows.Forms.MenuItem();
			this.menuLayerMoveDown = new System.Windows.Forms.MenuItem();
			this.menuLayerMoveBottom = new System.Windows.Forms.MenuItem();
			this.menuLayerRemove = new System.Windows.Forms.MenuItem();
			this.menuLayerRemoveSelected = new System.Windows.Forms.MenuItem();
			this.menuLayerRemoveAll = new System.Windows.Forms.MenuItem();
			this.menuItem3 = new System.Windows.Forms.MenuItem();
			this.menuField = new System.Windows.Forms.MenuItem();
			this.menuFieldSelect = new System.Windows.Forms.MenuItem();
			this.menuFieldSelectAll = new System.Windows.Forms.MenuItem();
			this.menuFieldSelectInvert = new System.Windows.Forms.MenuItem();
			this.menuFieldSelectNone = new System.Windows.Forms.MenuItem();
			this.menuItem2 = new System.Windows.Forms.MenuItem();
			this.menuTable = new System.Windows.Forms.MenuItem();
			this.menuRefreshTable = new System.Windows.Forms.MenuItem();
			this.menuTableFilter = new System.Windows.Forms.MenuItem();
			this.menuHelp = new System.Windows.Forms.MenuItem();
			this.menuHelpContent = new System.Windows.Forms.MenuItem();
			this.menuHelpAbout = new System.Windows.Forms.MenuItem();
			this.toolBar1 = new System.Windows.Forms.ToolBar();
			this.buttonExit = new System.Windows.Forms.ToolBarButton();
			this.buttonAdd = new System.Windows.Forms.ToolBarButton();
			this.buttonRemove = new System.Windows.Forms.ToolBarButton();
			this.separator1 = new System.Windows.Forms.ToolBarButton();
			this.buttonTop = new System.Windows.Forms.ToolBarButton();
			this.buttonUp = new System.Windows.Forms.ToolBarButton();
			this.buttonDown = new System.Windows.Forms.ToolBarButton();
			this.buttonBottom = new System.Windows.Forms.ToolBarButton();
			this.separator2 = new System.Windows.Forms.ToolBarButton();
			this.buttonTable = new System.Windows.Forms.ToolBarButton();
			this.buttonFilter = new System.Windows.Forms.ToolBarButton();
			this.buttonView = new System.Windows.Forms.ToolBarButton();
			this.buttonToGML = new System.Windows.Forms.ToolBarButton();
			this.buttonToSVG = new System.Windows.Forms.ToolBarButton();
			this.buttonAbout = new System.Windows.Forms.ToolBarButton();
			this.imageList1 = new System.Windows.Forms.ImageList(this.components);
			this.panel3 = new System.Windows.Forms.Panel();
			this.splitter1 = new System.Windows.Forms.Splitter();
			this.tabControl1 = new System.Windows.Forms.TabControl();
			this.tabFields = new System.Windows.Forms.TabPage();
			this.dgFields = new System.Windows.Forms.DataGrid();
			this.tabClassification = new System.Windows.Forms.TabPage();
			this.dgBins = new System.Windows.Forms.DataGrid();
			this.panel2 = new System.Windows.Forms.Panel();
			this.checkBoxShowNull = new System.Windows.Forms.CheckBox();
			this.buttonClassApply = new System.Windows.Forms.Button();
			this.label4 = new System.Windows.Forms.Label();
			this.comboClassCount = new System.Windows.Forms.ComboBox();
			this.label3 = new System.Windows.Forms.Label();
			this.comboClassField = new System.Windows.Forms.ComboBox();
			this.label2 = new System.Windows.Forms.Label();
			this.comboClassType = new System.Windows.Forms.ComboBox();
			this.tabTable = new System.Windows.Forms.TabPage();
			this.labelgenerating = new System.Windows.Forms.Label();
			this.dgTable = new System.Windows.Forms.DataGrid();
			this.tabInfo = new System.Windows.Forms.TabPage();
			this.dgInfo = new System.Windows.Forms.DataGrid();
			this.dgLayers = new System.Windows.Forms.DataGrid();
			this.panel1.SuspendLayout();
			this.panel3.SuspendLayout();
			this.tabControl1.SuspendLayout();
			this.tabFields.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dgFields)).BeginInit();
			this.tabClassification.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dgBins)).BeginInit();
			this.panel2.SuspendLayout();
			this.tabTable.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dgTable)).BeginInit();
			this.tabInfo.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dgInfo)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.dgLayers)).BeginInit();
			this.SuspendLayout();
			// 
			// progressBar1
			// 
			this.progressBar1.Dock = System.Windows.Forms.DockStyle.Right;
			this.progressBar1.Location = new System.Drawing.Point(293, 0);
			this.progressBar1.Name = "progressBar1";
			this.progressBar1.Size = new System.Drawing.Size(195, 15);
			this.progressBar1.Step = 5;
			this.progressBar1.TabIndex = 1;
			// 
			// panel1
			// 
			this.panel1.Controls.Add(this.label1);
			this.panel1.Controls.Add(this.progressBar1);
			this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
			this.panel1.Location = new System.Drawing.Point(2, 248);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(488, 15);
			this.panel1.TabIndex = 2;
			// 
			// label1
			// 
			this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.label1.Location = new System.Drawing.Point(0, 0);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(293, 15);
			this.label1.TabIndex = 2;
			// 
			// mainMenu1
			// 
			this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.menuFile,
																					  this.menuLayer,
																					  this.menuField,
																					  this.menuTable,
																					  this.menuHelp});
			// 
			// menuFile
			// 
			this.menuFile.Index = 0;
			this.menuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					 this.menuFileAdd,
																					 this.menuFilePreview,
																					 this.menuFileExport,
																					 this.menuItem6,
																					 this.menuFileExit});
			this.menuFile.Text = "File";
			// 
			// menuFileAdd
			// 
			this.menuFileAdd.Index = 0;
			this.menuFileAdd.Shortcut = System.Windows.Forms.Shortcut.CtrlA;
			this.menuFileAdd.Text = "Add";
			this.menuFileAdd.Click += new System.EventHandler(this.menuFileAdd_Click);
			// 
			// menuFilePreview
			// 
			this.menuFilePreview.Index = 1;
			this.menuFilePreview.Shortcut = System.Windows.Forms.Shortcut.CtrlV;
			this.menuFilePreview.Text = "Preview";
			this.menuFilePreview.Click += new System.EventHandler(this.menuFilePreview_Click);
			// 
			// menuFileExport
			// 
			this.menuFileExport.Index = 2;
			this.menuFileExport.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						   this.menuExportGML,
																						   this.menuExportSVG,
																						   this.menuItem7,
																						   this.menuItem5,

⌨️ 快捷键说明

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