/// <summary> /// 根据ID获取热键的信息。 /// </summary> /// <param name="id"></param> /// <returns></returns> public HotKeyInfo GetHotKeyInfo(int id) { HotKeyInfo info = null; if (Dic.ContainsKey(id)) { Dic.TryGetValue(id, out info); } return(info); }
/// <summary> /// 移除一个热键。 /// </summary> /// <param name="info"></param> /// <returns></returns> public bool Remove(HotKeyInfo info) { Dic.Remove(info.ID); UnregisterHotKey(info.Hand, info.ID); return(true); }
/// <summary> /// 添加一个热键。 /// </summary> /// <param name="info"></param> /// <returns></returns> public bool Add(HotKeyInfo info) { Dic.Add(info.ID, info); return(RegisterHotKey(info.Hand, info.ID, info.Modifiers, info.Key)); }