Ejemplo n.º 1
0
        private void btnCreatGeo_Click(object sender, EventArgs e)
        {
            GeoCoordinateDefine geoCoordinateDefine = new GeoCoordinateDefine(_spatialReference, enumControlType.Creat);

            geoCoordinateDefine.Text = "新建地理坐标系";
            TryApplyGeo(geoCoordinateDefine);
            if (geoCoordinateDefine.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                NeedSaveToFile();
            }
        }
Ejemplo n.º 2
0
 private void TryApplyGeo(GeoCoordinateDefine geoCoordinateDefine)
 {
     geoCoordinateDefine.ShowDialog();
     if (geoCoordinateDefine.DialogResult == System.Windows.Forms.DialogResult.OK)
     {
         if (geoCoordinateDefine.GeographicCoordSystem != null)
         {
             _geoCoordSystem        = geoCoordinateDefine.GeographicCoordSystem;
             _spatialReference      = new SpatialReference(_geoCoordSystem);
             txtSpatialRefInfo.Text = _spatialReference.ToString();
         }
     }
 }
Ejemplo n.º 3
0
 public void CollectionArgumentsCreat()
 {
     using (GeoCoordinateDefine geoCoordinateDefine = new GeoCoordinateDefine(_spatialReference, enumControlType.Creat))
     {
         if (geoCoordinateDefine.ShowDialog() == DialogResult.OK)
         {
             _geoCoordSystem = geoCoordinateDefine.GeographicCoordSystem;
         }
         else if (_spatialReference != null)
         {
             _geoCoordSystem = _spatialReference.GeographicsCoordSystem;
         }
     }
 }
Ejemplo n.º 4
0
        public void CollectionArgumentsModify()
        {
            _geoCoordSystem = _spatialReference.GeographicsCoordSystem;
            GeoCoordinateDefine geoCoordinateDefine = new GeoCoordinateDefine(_spatialReference, enumControlType.Modify);

            geoCoordinateDefine.ShowDialog();
            if (geoCoordinateDefine.DialogResult == DialogResult.OK)
            {
                //{
                _geoCoordSystem = geoCoordinateDefine.GeographicCoordSystem;
            }
            // btnModify.Enabled = true;
            // }
            //else if (geoCoordinateDefine.DialogResult == DialogResult.Cancel)
            //    return;
        }
Ejemplo n.º 5
0
 private void btnModify_Click(object sender, EventArgs e)
 {
     if (_spatialReference == null)
     {
         return;
     }
     _preSpatialReference = _spatialReference;
     if (_spatialReference.ProjectionCoordSystem == null)
     {
         GeoCoordinateDefine geoCoordinateDefine = new GeoCoordinateDefine(_spatialReference, enumControlType.Modify);
         geoCoordinateDefine.Text = "地理坐标系属性";
         TryApplyGeo(geoCoordinateDefine);
         if (geoCoordinateDefine.DialogResult == System.Windows.Forms.DialogResult.OK)
         {
             //IsSame()函数中没有对名字进行比较
             if (!_spatialReference.IsSame(_preSpatialReference) ||
                 (_spatialReference.GeographicsCoordSystem.Name != _preSpatialReference.GeographicsCoordSystem.Name))
             {
                 NeedSaveToFile();
             }
         }
     }
     else
     {
         PrjCoordinateDefine prjCoordinateDefine = new PrjCoordinateDefine(_spatialReference, enumControlType.Modify);
         prjCoordinateDefine.Text = "投影坐标系属性";
         TryApplyPrj(prjCoordinateDefine);
         if (prjCoordinateDefine.DialogResult == System.Windows.Forms.DialogResult.OK)
         {
             if (!_spatialReference.IsSame(_preSpatialReference) ||
                 (_spatialReference.GeographicsCoordSystem.Name != _preSpatialReference.GeographicsCoordSystem.Name) ||
                 (_spatialReference.Name != _preSpatialReference.Name))
             {
                 NeedSaveToFile();
             }
         }
     }
 }