Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        public void RegisterHotKey()
        {
            if (IsKeyRegistered)
            {
                UnregisterHotKey();
            }

            IsKeyRegistered = YHotKeyManager.RegisterHotKey(Handle, Id, KeyModifier, (int)Key);
            if (!IsKeyRegistered)
            {
                throw new ApplicationException("已存在该热键");
            }
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 public void UnregisterHotKey()
 {
     IsKeyRegistered = !YHotKeyManager.UnregisterHotKey(Handle, Id);
 }