コード例 #1
0
ファイル: HotKey.cs プロジェクト: rajeshwarn/MochaNote
 /// <summary>
 /// Unregister all registered hot keys
 /// </summary>
 private void UnregisterAll()
 {
     foreach (KeyValuePair <int, string> hotKey in _idToHotKey)
     {
         HotKeyUtils.UnregisterKey(this, hotKey.Key);
         HotKeyUtils.GlobalDeleteAtom(hotKey.Key);
     }
     _idToHotKey.Clear();
 }
コード例 #2
0
ファイル: HotKey.cs プロジェクト: rajeshwarn/MochaNote
        /// <summary>
        /// Unregister the specified registered hot keys
        /// </summary>
        /// <param name="strKey">registered hotkey</param>
        private void Unregister(string strKey)
        {
            int intKey = 0;

            foreach (KeyValuePair <int, string> hotKey in _idToHotKey)
            {
                if (hotKey.Value == strKey)
                {
                    intKey = hotKey.Key;
                    HotKeyUtils.UnregisterKey(this, hotKey.Key);
                    HotKeyUtils.GlobalDeleteAtom(hotKey.Key);
                    break;
                }
            }
            if (intKey > 0)
            {
                _idToHotKey.Remove(intKey);
            }
        }