void SpatialReference_Click(object sender, EventArgs e) { if (_dataset == null || _fdb == null) { Refresh(); if (_dataset == null || _fdb == null) { MessageBox.Show("Can't open dataset..."); return; } } FormSpatialReference dlg = new FormSpatialReference(_dataset.SpatialReference); if (dlg.ShowDialog() == DialogResult.OK) { int id = _fdb.CreateSpatialReference(dlg.SpatialReference); if (id == -1) { MessageBox.Show("Can't create Spatial Reference!\n", _fdb.lastErrorMsg); return; } if (!_fdb.SetSpatialReferenceID(_dataset.DatasetName, id)) { MessageBox.Show("Can't set Spatial Reference!\n", _fdb.lastErrorMsg); return; } _dataset.SpatialReference = dlg.SpatialReference; } }
private void btnGetSR_Click(object sender, EventArgs e) { FormSpatialReference dlg = new FormSpatialReference(this.SpatialReference); if (dlg.ShowDialog() == DialogResult.OK) { this.SpatialReference = dlg.SpatialReference; } }
private void btnSpatialReference_Click(object sender, EventArgs e) { FormSpatialReference dlg = new FormSpatialReference(this.SpatialReference); if (dlg.ShowDialog() == DialogResult.OK) { this.SpatialReference = dlg.SpatialReference; if (this.SpatialReference != null) { txtSpatialReference.Text = this.SpatialReference.Name + "/" + this.SpatialReference.Description; } } }
private void btnGetSRef_Click(object sender, EventArgs e) { ISpatialReference sRef = (cmbSRef.SelectedItem is SpatialReferenceItem) ? ((SpatialReferenceItem)cmbSRef.SelectedItem).SpatialReference : null; FormSpatialReference dlg = new FormSpatialReference(sRef.Clone() as ISpatialReference); if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.SpatialReference != null && (sRef == null || !dlg.SpatialReference.Equals(sRef))) { SpatialReferenceItem item = new SpatialReferenceItem(dlg.SpatialReference); _items.Add(item); cmbSRef.Items.Add(item); cmbSRef.SelectedItem = item; } } }