private void btnAdd_Click(object sender, EventArgs e) { ConfigAddForm addForm = new ConfigAddForm(); addForm.ShowDialog(); ConfigClass val = addForm.config; if (val == null) { return; } hotKeys.Add(val.getKeyPairs().GetHashCode(), val); addViewItem(val); btnApply.Enabled = true; }
private void btnEdit_Click(object sender, EventArgs e) { int idx = keysListView.SelectedItems[0].ImageIndex; ConfigAddForm editForm = new ConfigAddForm(hotKeys[idx]); editForm.ShowDialog(); ConfigClass val = editForm.config; if (val == null) { return; } hotKeys.Remove(idx); hotKeys.Add(val.getKeyPairs().GetHashCode(), val); keysListView.Items.Remove(keysListView.SelectedItems[0]); addViewItem(val); btnApply.Enabled = true; }