/// <summary> 双击某快捷键进入编辑 /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CurrentNode_dataGridView_DoubleClick(object sender, EventArgs e) { if (((MouseEventArgs)e).Button != MouseButtons.Left) { return; } DataGridViewSelectedRowCollection SelectedRowArrayTemp = CurrentNode_dataGridView.SelectedRows; if (SelectedRowArrayTemp.Count == 0) { return; } DataGridViewRow SelectedRowTemp = SelectedRowArrayTemp[0]; string CurrentID = SelectedRowTemp.Cells["ShortCutKeyID"].Value.ToString(); tShortCutKey CurrentEntity = tShortCutKeyDataSource.Where(T1 => T1.ShortCutKeyID == CurrentID).FirstOrDefault(); if (CurrentEntity == null) { return; } frmShortcutKey_Edit frm = new frmShortcutKey_Edit(CurrentEntity); if (frm.ShowDialog() == DialogResult.OK) { new ShortcutKeyManageService().UpdateShortcutKey(frm.CurrentEntity); InitKeyList(); } }
/// <summary> /// 添加一个快捷键 /// </summary> public void AddtShortcutKey(tShortCutKey Param) { Task.Delay(100).ContinueWith(task => { Invoke(new Action(() => { Param.ShortCutKeyImg = UniversalMethod.ByteArayToHex(OfficeTools.Resource.Image.Image.ShortcutKeyDefualtImage.ToImage().ToByteArray()); frmShortcutKey_Edit frm = new frmShortcutKey_Edit(Param); string NewID = ""; if (frm.ShowDialog() == DialogResult.OK) { NewID = new ShortcutKeyManageService().AddShortCutKey(frm.CurrentEntity); if (!string.IsNullOrEmpty(NewID)) { InitKeyList(); } } })); }); }