示例#1
0
        private void txtSpatailRef_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            m_SpatailReference       = null;
            m_SpatialReferenceString = null;

            dlgSpatialRef.Filter = "空间参考文件(*.Prj)|*.prj";
            if (dlgSpatialRef.ShowDialog(this) == DialogResult.OK)
            {
                //string[] strSpatialRef = System.IO.File.ReadAllLines(dlgSpatialRef.FileName);
                //if (strSpatialRef.Length > 0)
                //    m_SpatialReferenceString = strSpatialRef[0];

                try
                {
                    m_SpatailReference       = SpatialReferenctHelper.CreateSpatialReference(dlgSpatialRef.FileName);
                    m_SpatialReferenceString = SpatialReferenctHelper.ToGpString(m_SpatailReference);

                    txtSpatailRef.Text = m_SpatailReference.Name;
                }
                catch
                {
                    XtraMessageBox.Show("非正确的空间参考文件!");
                }
            }
        }
示例#2
0
        private void txtSpatailRef_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            m_SpatailReference       = null;
            m_SpatialReferenceString = null;

            dlgWorkspace.Filter = "空间参考文件(*.Prj)|*.prj";
            if (dlgWorkspace.ShowDialog(this) == DialogResult.OK)
            {
                string[] strSpatialRef = System.IO.File.ReadAllLines(dlgWorkspace.FileName);
                if (strSpatialRef.Length > 0)
                {
                    m_SpatialReferenceString = strSpatialRef[0];
                }

                m_SpatailReference = SpatialReferenctHelper.CreateSpatialReference(dlgWorkspace.FileName);
                txtSpatailRef.Text = m_SpatailReference.Name;
            }
        }