Esempio n. 1
0
        public static bool RegisterHotKey(this HotKeyData keyData, Form parent)
        {
            if (!keyData.UseHotKey)
            {
                return(true);
            }

            // update HotKey
            User32HotKey.KeyModifiers modifiers = User32HotKey.KeyModifiers.None;

            if (keyData.KeyData.HasFlag(Keys.Control))
            {
                modifiers |= User32HotKey.KeyModifiers.Control;
            }
            if (keyData.KeyData.HasFlag(Keys.Shift))
            {
                modifiers |= User32HotKey.KeyModifiers.Shift;
            }
            if (keyData.KeyData.HasFlag(Keys.Alt))
            {
                modifiers |= User32HotKey.KeyModifiers.Alt;
            }
            if (keyData.KeyData.HasFlag(Keys.LWin) || keyData.KeyData.HasFlag(Keys.RWin))
            {
                modifiers |= User32HotKey.KeyModifiers.Windows;
            }

            Keys key = (Keys)((int)keyData.KeyData & 0x0000FFFF); //filter out modifiers

            LogC.WriteLine("RegisterHotKey: " + keyData);
            return(User32HotKey.RegisterHotKey(parent.Handle, keyData.AppId, modifiers, key));
        }        //end RegisterHotKey
Esempio n. 2
0
        }        //end RegisterHotKey

        public static void UnregisterHotKey(this HotKeyData keyData, Form parent)
        {
            LogC.WriteLine("UnregisterHotKey: " + keyData);
            User32HotKey.UnregisterHotKey(parent.Handle, keyData.AppId);
        } //end UnregisterHotKey
Esempio n. 3
0
 public void Warning()
 {
     LogC.WriteLine(LogLevel.Warn, "warning!  someone called warning()!");
 }
Esempio n. 4
0
 public Test()
 {
     // this message won't get logged because LINFO is too low
     LogC.WriteLine(LogLevel.Info, "constructed a test object");
 }