コード例 #1
0
        public bool TryRemove(string name, out IHotKeyCommand command)
        {
            if (this.TryGetCommand(name, out command))
            {
                this.registryByName.Remove(name);
                this.indexByHashCode.Remove(command.GetHashCode());

                return(true);
            }

            return(false);
        }
コード例 #2
0
        public bool TryGetCommand(int hashCode, out IHotKeyCommand command)
        {
            string name;

            if (this.TryGetName(hashCode, out name))
            {
                return(this.registryByName.TryGetValue(name, out command));
            }

            command = null;
            return(false);
        }
コード例 #3
0
 public bool TryGetCommand(string name, out IHotKeyCommand command)
 {
     return(this.registryByName.TryGetValue(name, out command));
 }
コード例 #4
0
 public void Register(string name, IHotKeyCommand command)
 {
     this.registryByName.Add(name, command);
     this.indexByHashCode.Add(command.GetHashCode(), name);
 }