private void btnAdd_Click(object sender, EventArgs e) { AppItem appItem = new AppItem(); FormShortCutEdit dlg = new FormShortCutEdit(appItem); dlg.Text = "添加快捷方式"; if (DialogResult.OK == dlg.ShowDialog()) { mAppItems.Add(new AppItemObject(dlg.GetAppItem(), "", false)); RefreshListView(); } }
private void btnEdit_Click(object sender, EventArgs e) { var lt = this.listView1.SelectedItems; if (lt.Count > 0) { int nIndex = lt[0].ImageIndex; FormShortCutEdit dlg = new FormShortCutEdit(mAppItems[nIndex].AppItem); dlg.Text = "修改快捷方式"; if (DialogResult.OK == dlg.ShowDialog()) { mAppItems[nIndex].AppItem = dlg.GetAppItem(); RefreshListView(); } } }