Exemple #1
0
 static Int32 FindHotKeyAtom(HotKey hk)
 {
     foreach (DictionaryEntry ent in m_HotKeys)
     {
         if (ent.Value.ToString() == hk.ToString())
         {
             return(Convert.ToInt32(ent.Key));
         }
     }
     return(0);
 }
Exemple #2
0
 public static int FindHotKeyAction(HotKey hk)
 {
     lock (m_HotKeyActions)
     {
         foreach (DictionaryEntry ent in m_HotKeyActions)
         {
             if (ent.Value.ToString() == hk.ToString())
             {
                 return(Convert.ToInt32(ent.Key));
             }
         }
         return(0);
     }
 }
Exemple #3
0
 public static bool RegisterHotKeyAction(int action, HotKey hk)
 {
     lock (m_HotKeyActions)
     {
         if (m_HotKeyActions.ContainsKey(action))
         {
             if (m_HotKeyActions[action].ToString() != hk.ToString())
             {
                 UnregisterHotKey(m_HotKeyActions[action] as HotKey);
                 m_HotKeyActions.Remove(action);
             }
             else
             {
                 return(true);
             }
         }
         if (!RegisterHotKey(hk))
         {
             return(false);
         }
         m_HotKeyActions[action] = hk;
         return(true);
     }
 }
Exemple #4
0
 public static int FindHotKeyAction(HotKey hk)
 {
     lock (m_HotKeyActions)
     {
         foreach (DictionaryEntry ent in m_HotKeyActions)
         {
             if (ent.Value.ToString() == hk.ToString()) return Convert.ToInt32(ent.Key);
         }
         return 0;
     }
 }
Exemple #5
0
 static Int32 FindHotKeyAtom(HotKey hk)
 {
     foreach (DictionaryEntry ent in m_HotKeys)
     {
         if (ent.Value.ToString() == hk.ToString())
         {
             return Convert.ToInt32(ent.Key);
         }
     }
     return 0;
 }
Exemple #6
0
 public static bool RegisterHotKeyAction(int action, HotKey hk)
 {
     lock (m_HotKeyActions)
     {
         if (m_HotKeyActions.ContainsKey(action))
         {
             if (m_HotKeyActions[action].ToString() != hk.ToString())
             {
                 UnregisterHotKey(m_HotKeyActions[action] as HotKey);
                 m_HotKeyActions.Remove(action);
             }
             else
             {
                 return true;
             }
         }
         if (!RegisterHotKey(hk)) return false;
         m_HotKeyActions[action] = hk;
         return true;
     }
 }