private void btnAddEpsg_Click(object sender, EventArgs e) { if (_metadata != null) { ProjDBTables tables = new ProjDBTables(); FormSpatialReferenceSystems dlg = new FormSpatialReferenceSystems(tables); if (dlg.ShowDialog() == DialogResult.OK) { try { ISpatialReference sRef = dlg.SpatialRefererence; if (!sRef.Name.ToLower().StartsWith("epsg:")) { MessageBox.Show("Only spatialreference system with EPSG-Code allowed"); return; } int epsg = int.Parse(sRef.Name.Split(':')[1]); if (!_metadata.EPSGCodes.Contains(epsg)) { _metadata.EPSGCodes.Add(epsg); } FillEpsgList(); cmbEpsgs.SelectedItem = epsg; } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } } }
private void btnAdd_Click(object sender, EventArgs e) { FormSpatialReferenceSystems dlg = new FormSpatialReferenceSystems(ProjDBTables.projs); if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.SpatialRefererence != null) { lstCodes.Items.Add(dlg.SpatialRefererence.Name); Commit(); } } }