private void btn_delcoordset_Click(object sender, EventArgs e) { if (nfccoords.Length > 1) { this.loading = true; NFCCoords[] tmp = new NFCCoords[nfccoords.Length - 1]; int j = 0; for (int i = 0; i < nfccoords.Length; i++) { if (i == cb_coordset.SelectedIndex) { } else { tmp[j] = this.nfccoords[i]; j++; } } this.nfccoords = tmp; this.coordlist.Items.Clear(); this.coords.Clear(); this.cb_coordset.Items.Clear(); for (int i = 0; i < nfccoords.Length; i++) { this.cb_coordset.Items.Add("Coordset " + (i + 1)); } this.count_coords = nfccoords[0].coords.Length - 1; this.cb_coordset.Enabled = true; for (int i = 0; i < nfccoords[0].coords.Length - 1; i++) { this.coords.Add(nfccoords[0].coords[i]); this.coordlist.Items.Add((i + 1).ToString() + ". x:" + (Convert.ToInt32((nfccoords[0].coords[i].X) * 5.25) + (x * 16128)).ToString() + " y:" + (Convert.ToInt32((3072 - (nfccoords[0].coords[i].Y)) * 5.25) + (y * 16128)).ToString()); } this.cb_coordset.SelectedIndex = 0; if (nfccoords.Length <= 1) { this.btn_delcoordset.Enabled = false; this.cb_coordset.Enabled = false; } this.actindex = cb_coordset.SelectedIndex; this.loading = false; } }
private void button1_Click(object sender, EventArgs e) { this.loading = true; this.coordsetcnt = this.coordsetcnt + 1; NFCCoords[] tmpcoordsets = new NFCCoords[this.coordsetcnt]; if (coordsetcnt > 2) { for (int i = 0; i < this.coordsets.Length; i++) { tmpcoordsets[i] = coordsets[i]; } } tmpcoordsets[cb_coordset.SelectedIndex] = new NFCCoords(); tmpcoordsets[cb_coordset.SelectedIndex].cnt_coords = this.coords.Count; tmpcoordsets[cb_coordset.SelectedIndex].coords = new PointF[this.coords.Count + 1]; this.coordlist.Items.Clear(); tmpcoordsets[cb_coordset.SelectedIndex].coords = new PointF[this.coords.Count + 1]; for (int i = 0; i < this.coords.Count; i++) { if (i == 0) { tmpcoordsets[cb_coordset.SelectedIndex].coords[this.coords.Count] = coords[i]; } tmpcoordsets[cb_coordset.SelectedIndex].coords[i] = coords[i]; //this.coordlist.Items.Add((i + 1).ToString() + ". x:" + (Convert.ToInt32((this.coordsets[cb_coordset.SelectedIndex].coords[i].X) * 5.25) + (this.mapx * 16128)).ToString() + " y:" + (Convert.ToInt32((3072 - (this.coordsets[cb_coordset.SelectedIndex].coords[i].Y)) * 5.25) + (this.mapy * 16128)).ToString()); } this.count_coords = 0; this.cb_coordset.Items.Add("Coordset " + coordsetcnt.ToString()); this.coords.Clear(); this.cb_coordset.SelectedIndex = coordsetcnt - 1; this.actindex = this.cb_coordset.SelectedIndex; this.coordsets = tmpcoordsets; this.loading = false; this.btn_addcoordset.Enabled = false; this.brn_qpfsave.Enabled = false; this.nfcediter = false; this.cb_coordset.Enabled = this.nfcediter; this.btn_editcoord.Enabled = false; this.btn_delcoord.Enabled = false; }