private void btnGetRandomPoints_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.txtLayerPath.Text)) { MessageBox.Show("请指定地图文件路径。"); return; } if (rdbSetCountPoints.Checked && string.IsNullOrEmpty(txtPointCount.Text)) { MessageBox.Show("请指定需要产生的轨迹点的目数。"); return; } int iInterval = 0; if (!int.TryParse(this.txtInterval.Text, out iInterval)) { MessageBox.Show("请确定输入了正确的时间间隔."); return; } if (this._layer != null) { int iPointCount = rdbAllPoints.Checked ? this._layer.Records.Count : Int32.Parse(this.txtPointCount.Text.Trim()); GPSGatewaySimulator.RandomPoints.GeneryRandomPoints oRandomPoints = new GPSGatewaySimulator.RandomPoints.GeneryRandomPoints(); this._result = oRandomPoints.GetPointsFromRoadLayer(iPointCount, iInterval, this._layer); this.DialogResult = DialogResult.OK; } }
private void btnGetRandomPoints_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.txtLayerPath.Text)) { MessageBox.Show("��ָ����ͼ�ļ�·����"); return; } if (rdbSetCountPoints.Checked && string.IsNullOrEmpty(txtPointCount.Text)) { MessageBox.Show("��ָ����Ҫ�����Ĺ켣���Ŀ����"); return; } int iInterval = 0; if (!int.TryParse(this.txtInterval.Text, out iInterval)) { MessageBox.Show("��ȷ����������ȷ��ʱ����."); return; } if (this._layer != null) { int iPointCount = rdbAllPoints.Checked ? this._layer.Records.Count : Int32.Parse(this.txtPointCount.Text.Trim()); GPSGatewaySimulator.RandomPoints.GeneryRandomPoints oRandomPoints = new GPSGatewaySimulator.RandomPoints.GeneryRandomPoints(); this._result = oRandomPoints.GetPointsFromRoadLayer(iPointCount,iInterval, this._layer); this.DialogResult = DialogResult.OK; } }