Ejemplo n.º 1
0
 public HotkeyToken(ITrie <ICombination, KeyEventCommand> trie, IList <ICombination> hotkey,
                    KeyEventCommand eventCommand)
 {
     _trie        = trie;
     _hotkey      = hotkey;
     EventCommand = eventCommand;
 }
Ejemplo n.º 2
0
        public IMetaKey Add(IList <ICombination> combinations, KeyEventCommand command,
                            string stateTree = KeyStateTrees.Default)
        {
            var keyStateTree = KeyStateTree.GetOrCreateStateTree(stateTree);

            return(keyStateTree.Add(combinations, command));
        }
Ejemplo n.º 3
0
 public IMetaKey Add(IList <ICombination> combinations, KeyEventCommand command)
 {
     if (TreeType == TreeType.SingleEventCommand)
     {
         var commands = _trie.Get(combinations);
         if (commands.Count() != 0)
         {
             _trie.Remove(combinations, c => c.KeyEvent == command.KeyEvent);
         }
     }
     _trie.Add(combinations, command);
     return(new MetaKey(_trie, combinations, command));
 }
Ejemplo n.º 4
0
 public IMetaKey Add(ICombination combination, KeyEventCommand command)
 {
     return(Add(new List <ICombination> {
         combination
     }, command));
 }