private void btn_Add_Click(object sender, EventArgs e) { List <byte> tmp = null; if ((tmp = analyse()) != null) { 批量发送信息 tmpdata = new 批量发送信息() { data = tmp.ToArray(), en = check_使能.Checked, timeout = (int)numericUpDown1.Value, sn = (dataList.Count + 1) }; dataList.Add(tmpdata); refreshDgv(true); } }
private void btn_Modify_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 0) { return; } int index = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[1].Value) - 1; 批量发送信息 tmp1 = dataList[index]; List <byte> tmp = null; if ((tmp = analyse()) != null) { tmp1.en = check_使能.Checked; tmp1.data = tmp.ToArray(); tmp1.timeout = (int)numericUpDown1.Value; refreshDgv(true); } }