private void FrmLayers_Load(object sender, EventArgs e) { foreach (var item in mMap.Layers) { ILayer lyr = item; ListViewItem li = new ListViewItem(); if (lyr is FetureLayer) { FetureLayer featLyr = lyr as FetureLayer; RgEnumShapeType shapeType = featLyr.ShapeType; li.Text = lyr.Name; // li.SubItems[0].Text = i.ToString(); li.SubItems.Add(shapeType.ToString()); if (mMap.CurrentLayer == lyr) { li.SubItems.Add("是"); li.ImageIndex = 1; liCurrent = li; } else { li.SubItems.Add("否"); li.ImageIndex = 0; } if (lyr.Visible) { li.Checked = true; } li.Tag = lyr; listView1.Items.Add(li); } } }
private void btnOK_Click(object sender, EventArgs e) { strFeatureName = this.textBox1.Text.Trim(); int idx = comboBox1.SelectedIndex; if (idx == 0) { mShapeType = RgEnumShapeType.RgPoint; } else if (idx == 1) { mShapeType = RgEnumShapeType.RgLineString; } else if (idx == 2) { mShapeType = RgEnumShapeType.RgPolygon; } this.DialogResult = DialogResult.OK; }
private void btnOK_Click(object sender, EventArgs e) { strFeatureName = this.txtLayerName.Text.Trim(); if (strFeatureName.Trim() == string.Empty) { MessageBox.Show("图层名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } int idx = cmbShapeType.SelectedIndex; if (idx == 0) { mShapeType = RgEnumShapeType.RgPoint; } else if (idx == 1) { mShapeType = RgEnumShapeType.RgLineString; } else if (idx == 2) { mShapeType = RgEnumShapeType.RgPolygon; } this.DialogResult = DialogResult.OK; }