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

📄 dataout.cs

📁 煤矿信息管理系统是基于SuperMap Object
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.comboBox_file.Name = "comboBox_file";
			this.comboBox_file.Size = new System.Drawing.Size(160, 20);
			this.comboBox_file.TabIndex = 1;
			this.comboBox_file.SelectedIndexChanged += new System.EventHandler(this.comboBox_file_SelectedIndexChanged);
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(8, 23);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(56, 16);
			this.label3.TabIndex = 0;
			this.label3.Text = "文件类型";
			// 
			// pictureBox1
			// 
			this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.pictureBox1.Location = new System.Drawing.Point(14, 272);
			this.pictureBox1.Name = "pictureBox1";
			this.pictureBox1.Size = new System.Drawing.Size(538, 4);
			this.pictureBox1.TabIndex = 4;
			this.pictureBox1.TabStop = false;
			// 
			// btn_ok
			// 
			this.btn_ok.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btn_ok.Location = new System.Drawing.Point(288, 282);
			this.btn_ok.Name = "btn_ok";
			this.btn_ok.Size = new System.Drawing.Size(75, 24);
			this.btn_ok.TabIndex = 5;
			this.btn_ok.Text = "导 出";
			this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
			// 
			// btn_esc
			// 
			this.btn_esc.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btn_esc.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btn_esc.Location = new System.Drawing.Point(408, 282);
			this.btn_esc.Name = "btn_esc";
			this.btn_esc.Size = new System.Drawing.Size(75, 24);
			this.btn_esc.TabIndex = 6;
			this.btn_esc.Text = "放 弃";
			this.btn_esc.Click += new System.EventHandler(this.btn_esc_Click);
			// 
			// pictureBox2
			// 
			this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
			this.pictureBox2.Location = new System.Drawing.Point(16, 16);
			this.pictureBox2.Name = "pictureBox2";
			this.pictureBox2.Size = new System.Drawing.Size(160, 248);
			this.pictureBox2.TabIndex = 7;
			this.pictureBox2.TabStop = false;
			// 
			// DataOut
			// 
			this.AcceptButton = this.btn_ok;
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.CancelButton = this.btn_esc;
			this.ClientSize = new System.Drawing.Size(568, 309);
			this.Controls.Add(this.pictureBox2);
			this.Controls.Add(this.btn_esc);
			this.Controls.Add(this.btn_ok);
			this.Controls.Add(this.pictureBox1);
			this.Controls.Add(this.groupBox2);
			this.Controls.Add(this.groupBox1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "DataOut";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "数据集导出";
			this.Load += new System.EventHandler(this.DataOut_Load);
			this.groupBox1.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void DataOut_Load(object sender, System.EventArgs e)
		{
			this.myExport = this.myPump.DataExportParams;
			add_list(this.dateset);
		}

		private void btn_esc_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}


		#region 加载数据源列表
		


		private void add_list(string[] dataset)
		{
			
			foreach(string aa in dataset)
			{
				ListViewItem ite = new ListViewItem(new string[] {aa,aa,"未转"});
				this.listView_data.Items.Add(ite);
			}
		}


		#endregion

		private void btn_url_Click(object sender, System.EventArgs e)
		{
			FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();

			if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) 
			{
				this.txt_url.Text = folderBrowserDialog1.SelectedPath;
			}

		}
		

		private void comboBox_file_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			
			int a = this.comboBox_file.SelectedIndex;
			switch(a)
			{
				case 0:
					this.myExport.FileType = SuperMapLib.seFileType.scfMIF;
					break;
				case 1:
					this.myExport.FileType = SuperMapLib.seFileType.scfVCT;
					break;
				case 2:
					this.myExport.FileType = SuperMapLib.seFileType.scfDXF;
					break;
				case 3:
					this.myExport.FileType = SuperMapLib.seFileType.scfMapGis;
					break;
				case 4:
					this.myExport.FileType = SuperMapLib.seFileType.scfSHP;
					break;
				case 5:
					this.myExport.FileType = SuperMapLib.seFileType.scfE00;
					break;
				case 6:
					this.myExport.FileType = SuperMapLib.seFileType.scfBMP;
					break;
			}
			
		}

		private void comboBox_unit_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			int a = this.comboBox_unit.SelectedIndex;
			switch(a)
			{
				case 0:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuDegree;
					break;
				case 1:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuMillimeter;
					break;
				case 2:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuCentimeter;
					break;
				case 3:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuInch;
					break;
				case 4:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuDecimeter;
					break;
				case 5:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuFoot;
					break;
				case 6:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuYard;
					break;
				case 7:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuMeter;
					break;
				case 8:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuKilometer;
					break;
				case 9:
					this.myExport.DesUnits = SuperMapLib.seUnits.scuMile;
					break;
					
			}
		}

		private void btn_select_all_Click(object sender, System.EventArgs e)
		{
			int a = this.listView_data.Items.Count;
			for(int i = 0;i<a;i++)
			{
				this.listView_data.Items[i].Checked = true;
			}
		}

		private void btn_select_no_Click(object sender, System.EventArgs e)
		{
			int a = this.listView_data.Items.Count;
			for(int i = 0;i<a;i++)
			{
				this.listView_data.Items[i].Checked = (this.listView_data.Items[i].Checked)?false:true;
			}

		}

		private void btn_ok_Click(object sender, System.EventArgs e)
		{

			if(this.txt_url.Text.Length==0)
			{
				MessageBox.Show("请设定输出目录","错误信息",MessageBoxButtons.OK,MessageBoxIcon.Warning);
			}
			else
			{
				
				int a = this.listView_data.Items.Count;
				for(int i=0;i<a;i++)
				{
					if(this.listView_data.Items[i].Checked)
					{ 
						
						this.myExport.DatasetToBeExported = this.listView_data.Items[i].SubItems[1].Text.Trim();
						this.myExport.FileName = this.txt_url.Text+"\\"+this.listView_data.Items[i].SubItems[0].Text;
						if(this.myPump.Export())
						{
							this.listView_data.Items[i].SubItems[2].Text="成功";
						}
						else
						{
							this.listView_data.Items[i].SubItems[2].Text="失败";
						}
					}
				}
			}

		}
	}
}

⌨️ 快捷键说明

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