private void B_Draw_Click(object sender, EventArgs e) { string layerName = Com_CadLayer.SelectedItem.ToString(); //绘制于当前图层 Draw_Station_Location dsl = new Draw_Station_Location(); StationAndLocation station_location = new StationAndLocation("1", "AA", "AA1+000"); dsl.drawSL(station_location, layerName); //dsl.DrawStationMark(new Autodesk.AutoCAD.Geometry.Point3d(), true); }
//添加车站信息 private void B_AddSt_Click(object sender, EventArgs e) { if (T_AddSt.Text == "添加站点" || T_AddSt.Text == "") { MessageBox.Show("需要指定站或里程", "注意", MessageBoxButtons.OK, MessageBoxIcon.Hand); } else { FonctionsCs fonctions = new FonctionsCs(); List <string> ListDistance = new List <string>(); if (fonctions.isExMatch(T_AddSt.Text.ToString().Replace(" ", ""), @"^[\u4e00-\u9fa5]*$") && fonctions.isExMatch(T_StaLoc.Text.ToString().Replace(" ", "").ToUpper(), @"^([A-Z]*)(\d*)([A-Z]*)(\d*).(\d{0,4})$", out ListDistance)) { bool isInTheList = false; if (ListStation.ContainsKey(T_AddSt.Text.ToString().Replace(" ", "")) || ListStation.ContainsValue(T_StaLoc.Text.ToString().Replace(" ", "").ToUpper())) { isInTheList = true; } else { //在dataset中添加数据 addData(T_AddSt.Text.ToString().Replace(" ", ""), T_StaLoc.Text.ToString().Replace(" ", "").ToUpper()); dataGridView1.DataSource = DS_Station.Tables["StationAndInfo"]; //L_AddSt.Items.Add(T_AddSt.Text.ToString().Replace(" ", "") + "," + T_StaLoc.Text.ToString().Replace(" ", "").ToUpper()); // //将站点名称与里程添加进字典中 ListStation.Add(T_AddSt.Text.ToString().Replace(" ", ""), T_StaLoc.Text.ToString().Replace(" ", "").ToUpper()); //isEditStation.Add(T_AddSt.Text.ToString().Replace(" ", ""), T_StaLoc.Text.ToString().Replace(" ", "").ToUpper()); StationAndLocation StationAndLocation = new StationAndLocation(list_StationAndLocation.Count.ToString(), T_AddSt.Text.ToString().Replace(" ", ""), T_StaLoc.Text.ToString().Replace(" ", "").ToUpper()); list_StationAndLocation.Add(StationAndLocation); refreshCombobox(list_StationAndLocation); /* * this.comboBox_From.Items.Add(StationAndLocation); * this.comboBox_From.DisplayMember = "Name"; * this.comboBox_From.ValueMember = "Location"; * * this.comboBox_To.Items.Add(StationAndLocation); * this.comboBox_To.DisplayMember = "Name"; * this.comboBox_To.ValueMember = "Location"; */ if (groupBox1.Visible == false) { //this.Size = new Size(700, this.Size.Height); groupBox1.Visible = true; //groupBox1.Text = "站间设备设置"; } } /*else * { * MessageBox.Show("名称不符合规范" + System.Environment.NewLine + "或与管理员联系.", "注意", MessageBoxButtons.OK, MessageBoxIcon.Hand); * }*/ } } }
public BinoStation(StationAndLocation fromStation, StationAndLocation toStation) { this._fromStation = fromStation; this._toStation = toStation; }