public bool Add(HotKeyInfo info, HotKeyHandler handler) { if (!_registry.TryGetValue(info, out var existing)) { info.Id = Kernel32.GlobalAddAtom(info.ToString()); _registry.Add(info); _newInfo.Enqueue(info); Application.Exit(); } else { info = existing; } return(info.Handlers.Add(handler)); }
public bool Remove(HotKeyInfo info, HotKeyHandler handler) { return(_registry.TryGetValue(info, out info) ? info.Handlers.Remove(handler) : false); }