using DevExpress.XtraEditors; using Ips.Library.Basic; using Ips.Library.DxpLib; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Ips.Sps.Maps { public partial class DrawPointForm : DevExpress.XtraEditors.XtraForm { public DrawPointForm() { InitializeComponent(); } public string PointName { get; private set; } public double Lon { get; private set; } public double Lat { get; private set; } private void btnCancel_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; Close(); } private void btnOk_Click(object sender, EventArgs e) { string name; double lon, lat; name = txtName.Text; if (!double.TryParse(txtLon.Text, out lon)) { MsgHelper.ShowError("请输入正确的经度"); return; } if (!double.TryParse(txtLat.Text, out lat)) { MsgHelper.ShowError("请输入正确的纬度"); return; } if (!GeoUtil.IsValidPoint(lon, lat)) { MsgHelper.ShowError("请输入正确的经纬度"); return; } PointName = name; Lon = lon; Lat = lat; this.DialogResult = DialogResult.OK; } } }