private void toolStripMenuItem4_Click(object sender, EventArgs e) { TreeNode tn = treeView1.SelectedNode; if (tn == null) { return; } string layerID = Convert.ToString(tn.Tag); if (tn.Parent.Tag != null && tn.Parent.Tag.ToString() == "RASTER_LAYERS") { Demo.Entities.RasterLayer rl = Demo.Entities.RasterLayer.GetRasterIndexById(layerID); if (rl == null) { return; } FormMetaData fmd = new FormMetaData(rl); fmd.ShowDialog(); } else if (tn.Parent.Tag != null && tn.Parent.Tag.ToString() == "VECTOR_LAYERS") { VectorLayer vl = VectorLayer.GetVectorIndexById(layerID); if (vl == null) { return; } FormMetaData fmd = new FormMetaData(vl); fmd.ShowDialog(); } }
private void button1_Click(object sender, EventArgs e) { Demo.Entities.RasterLayer rl = Demo.Entities.RasterLayer.GetRasterIndexById(""); if (rl != null) { FormMetaData fmd = new FormMetaData(rl); fmd.ShowDialog(); } }
private void button2_Click(object sender, EventArgs e) { VectorLayer vl = VectorLayer.GetVectorIndexById(""); if (vl != null) { FormMetaData fmd = new FormMetaData(vl); fmd.ShowDialog(); } }
private void buttonOpen_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); switch (nowDT) { case enumDataType.raster: ofd.Filter = "栅格数据|*.tif;*.img;*.pix;*.bmp;*.jpg"; break; case enumDataType.dem: ofd.Filter = "地形数据|*.tif;*.img;*.pix;*.grd;*.dem"; break; case enumDataType.vector: ofd.Filter = "矢量数据|*.shp;*.e00;*.dwg;*.bmp;*.mif"; break; default: ofd.Filter = "数据|*.*"; break; } if (ofd.ShowDialog() == DialogResult.OK) { FormMetaData frmMD; textBoxImport.Text = ofd.FileName; ILayer pLayer = GetILayerFromPath(ofd.FileName); if (pLayer != null) { frmMD = new FormMetaData(pLayer); } else { frmMD = new FormMetaData(ofd.FileName); } if (frmMD.ShowDialog() == DialogResult.OK) { this.rstLayer = frmMD.rstLayer; this.vctLayer = frmMD.vctLayer; this.fleLayer = frmMD.fleLayer; } } }