/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAdd_Click(object sender, EventArgs e) { frmSendData f = new frmSendData(); DialogResult dr = f.ShowDialog(); if (dr == DialogResult.OK) { SendItem item = f.SendItem; App.Default.Config.SendCollection.Add(item); AddSendItemToListView(item); } }
void SendAdd_Click(object sender, EventArgs e) { byte[] bs; if (this.GetSendBytes(out bs)) { SendItem item = new SendItem(); item.Name = HexStringConverter.Default.ConvertToObject(bs).ToString(); item.Bytes = bs; frmSendData f = new frmSendData(item); if (f.ShowDialog() == DialogResult.OK) { this.SendCollection.Add(item); CreateContextMenu(); } } }
private void btnEdit_Click(object sender, EventArgs e) { ListViewItem lvi = GetSelectedListViewItem(); if (lvi == null) { SelectListViewItemFirst(); return; } SendItem item = lvi.Tag as SendItem; frmSendData f = new frmSendData(item); DialogResult dr = f.ShowDialog(); if (dr == DialogResult.OK) { lvi.Text = item.Name; string s = HexStringConverter.Default.ConvertToObject(item.Bytes).ToString(); lvi.SubItems[1].Text = s; } }
void SendAdd_Click(object sender, EventArgs e) { byte[] bs ; if (this.GetSendBytes(out bs)) { SendItem item = new SendItem(); item.Name = HexStringConverter.Default.ConvertToObject(bs).ToString(); item.Bytes = bs; frmSendData f = new frmSendData(item); if (f.ShowDialog() == DialogResult.OK) { this.SendCollection.Add(item); CreateContextMenu(); } } }