Example #1
0
        public void RemoveShortCutDelegate(IEnumerable<Keys> keys)
        {
            HotKeySet hotKeySet = new HotKeySet(keys);

            if (_shortCutDelegates.ContainsKey(hotKeySet))
            {
                _shortCutDelegates.Remove(hotKeySet);
                _shortCutListener.HotKeyCollection.Remove(hotKeySet);
            }
        }
Example #2
0
        public void SetShortCutDelegate(IEnumerable<Keys> keys, ShortCutDelegate shortCutDelegate)
        {
            _shortCutListener.Enabled = false;
            {
                RemoveShortCutDelegate(keys);

                var hotKeySet = new HotKeySet(keys);
                hotKeySet.OnHotKeysUp += OnHotKeysUp;

                _shortCutDelegates.Add(hotKeySet, shortCutDelegate);
                _shortCutListener.HotKeyCollection.Add(hotKeySet);
            }
            _shortCutListener.Enabled = true;
        }