Esempio n. 1
0
 void Invoke(HotKeyInfo info)
 {
     if (_registry.TryGetValue(info, out info))
     {
         foreach (var handler in info.Handlers)
         {
             handler.Invoke(info);
         }
     }
 }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 public void Invoke(HotKeyInfo info)
 {
     Handler(info);
 }
Esempio n. 4
0
 public bool Remove(HotKeyInfo info, HotKeyHandler handler)
 {
     return(_registry.TryGetValue(info, out info) ? info.Handlers.Remove(handler) : false);
 }