Exemplo n.º 1
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     if (this.listBox1.SelectedIndex > -1)
     {
         frmGaphicTransformation  transformation = new frmGaphicTransformation();
         ISpatialReferenceFactory factory        = new SpatialReferenceEnvironmentClass();
         ISpatialReference        reference      = null;
         if (this.cboTarget.SelectedIndex == 0)
         {
             reference = factory.CreateGeographicCoordinateSystem(4214);
         }
         else if (this.cboTarget.SelectedIndex == 1)
         {
             reference = factory.CreateGeographicCoordinateSystem(4610);
         }
         else
         {
             reference = factory.CreateGeographicCoordinateSystem(4326);
         }
         transformation.SourceSpatialReference =
             (this.listBox1.SelectedItem as ObjectWrap).Object as ISpatialReference;
         transformation.TargetSpatialReference = reference;
         if (transformation.ShowDialog() == DialogResult.OK)
         {
             this.txtConvertMethod.Text = transformation.GeoTransformations.Name;
             this.txtConvertMethod.Tag  = transformation.GeoTransformations;
             this.btnEdit.Enabled       = true;
         }
     }
 }
Exemplo n.º 2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (this.txtConvertMethod.Tag != null)
     {
         frmGaphicTransformation transformation = new frmGaphicTransformation
         {
             GeoTransformations = this.txtConvertMethod.Tag as IGeoTransformation
         };
         if (transformation.ShowDialog() == DialogResult.OK)
         {
             this.txtConvertMethod.Text = transformation.GeoTransformations.Name;
         }
     }
 }