private void lstData_MouseDoubleClick(object sender, MouseEventArgs e) { if (lstData.SelectedItems.Count == 0) { return; } CardForm df = new CardForm(Common.FormMode.Edit, lstData.SelectedItems[0].Text, (string)lstData.SelectedItems[0].Tag); df.ShowDialog(); }
private void btnAdd_Click(object sender, EventArgs e) { CardForm cf = new CardForm(Common.FormMode.Add, string.Empty, string.Empty); DialogResult dr = cf.ShowDialog(); if (dr == DialogResult.OK) { TopicEntries.Add(cf.Key, cf.Value); ListViewItem lvi = new ListViewItem(); lvi.Text = cf.Key; lvi.SubItems.Add(cf.Value); lvi.Tag = cf.Value; lstData.Items.Add(lvi); } }
private void btnEdit_Click(object sender, EventArgs e) { if (lstData.SelectedItems.Count == 0) { return; } CardForm cf = new CardForm(Common.FormMode.Edit, lstData.SelectedItems[0].Text, (string)lstData.SelectedItems[0].Tag); DialogResult dr = cf.ShowDialog(); if (dr == DialogResult.OK) { Data.TheData.UpdateTopicDataByName(_topicName, cf.Key, cf.Value); RefreshData(); } }