예제 #1
0
파일: MetaKey.cs 프로젝트: metaseed/Metakey
 public HotkeyToken(ITrie <ICombination, KeyEventCommand> trie, IList <ICombination> hotkey,
                    KeyEventCommand eventCommand)
 {
     _trie        = trie;
     _hotkey      = hotkey;
     EventCommand = eventCommand;
 }
예제 #2
0
        public IMetaKey Add(IList <ICombination> combinations, KeyEventCommand command,
                            string stateTree = KeyStateTrees.Default)
        {
            var keyStateTree = KeyStateTree.GetOrCreateStateTree(stateTree);

            return(keyStateTree.Add(combinations, command));
        }
예제 #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));
 }
예제 #4
0
 public IMetaKey Add(ICombination combination, KeyEventCommand command)
 {
     return(Add(new List <ICombination> {
         combination
     }, command));
 }