public bool Apply() { double num = 0.0; double num2 = 0.0; double num3 = 0.0; try { num = double.Parse(this.txtXInterval.Text); } catch { MessageBox.Show("请输入数字!"); return(false); } try { num2 = double.Parse(this.txtYInterval.Text); } catch { MessageBox.Show("请输入数字!"); return(false); } try { num3 = double.Parse(this.txtStartMultiple.Text); } catch { MessageBox.Show("请输入数字!"); return(false); } if (this.jlktkassiatant_0.TKType == TKType.TKStandard) { if (this.txtTH.Text.Trim().Length == 0) { MessageBox.Show("请输入图幅编号!"); return(false); } if (!THTools.ValidateTFNo(this.txtTH.Text.Trim())) { MessageBox.Show("图幅编号不正确!"); return(false); } } this.jlktkassiatant_0.XInterval = num; this.jlktkassiatant_0.YInterval = num2; this.jlktkassiatant_0.StartCoodinateMultiple = num3; this.jlktkassiatant_0.MapTM = this.txtTM.Text; this.jlktkassiatant_0.MapTH = this.txtTH.Text; this.jlktkassiatant_0.StripType = this.rdo3.Checked ? StripType.STThreeDeg : StripType.STSixDeg; return(true); }
private void btnCoord_Click(object sender, EventArgs e) { if (this.txtTH.Text.Trim() == "") { MessageBox.Show("请先输入图幅号"); } else { IList <IPoint> list = null; IPoint point = null; THTools tools = null; if (this.txtTH.Text.Trim() != "") { tools = new THTools(); bool flag = false; list = tools.GetProjectCoord(this.txtTH.Text.Trim(), true, true, 0, ref flag); if (flag) { if ((list != null) && (list.Count == 4)) { point = list[0]; if (!point.IsEmpty) { this.txtLeftUpX.Text = point.Y.ToString(); this.txtLeftUpY.Text = point.X.ToString(); } point = list[1]; if (!point.IsEmpty) { this.txtRightUpX.Text = point.Y.ToString(); this.txtRightUpY.Text = point.X.ToString(); } point = list[2]; if (!point.IsEmpty) { this.txtRightLowX.Text = point.Y.ToString(); this.txtRightLowY.Text = point.X.ToString(); } point = list[3]; if (!point.IsEmpty) { this.txtLeftLowX.Text = point.Y.ToString(); this.txtLeftLowY.Text = point.X.ToString(); } } else { MessageBox.Show("请检查图幅号是否正确。"); } } else { MessageBox.Show("请检查图幅号是否正确。"); } } if (list != null) { tools = null; point = null; list.Clear(); list = null; } } }