public HotkeyToken(ITrie <ICombination, KeyEventCommand> trie, IList <ICombination> hotkey, KeyEventCommand eventCommand) { _trie = trie; _hotkey = hotkey; EventCommand = eventCommand; }
public IMetaKey Add(IList <ICombination> combinations, KeyEventCommand command, string stateTree = KeyStateTrees.Default) { var keyStateTree = KeyStateTree.GetOrCreateStateTree(stateTree); return(keyStateTree.Add(combinations, command)); }
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)); }
public IMetaKey Add(ICombination combination, KeyEventCommand command) { return(Add(new List <ICombination> { combination }, command)); }