public void SetUp()
 {
     manager = new HotKeyManager();
     Log.Writer = System.Console.Out;
     window = NewMock<IWin32Window>();
     Stub.On(window).GetProperty("Handle").Will(Return.Value(IntPtr.Zero));
     hotKey = NewMock<IHotKeyCodeProvider>();
 }
Example #2
0
 public void SetUp()
 {
     manager    = new HotKeyManager();
     Log.Writer = System.Console.Out;
     window     = NewMock <IWin32Window>();
     Stub.On(window).GetProperty("Handle").Will(Return.Value(IntPtr.Zero));
     hotKey = NewMock <IHotKeyCodeProvider>();
 }
Example #3
0
 public bool Register(IWin32Window window, int id, IHotKeyCodeProvider hotKey)
 {
     try
     {
         if (window == null)
         {
             Log.Error("Could not register hot key for null window");
             return(false);
         }
         if (hotKey == null)
         {
             Log.Error("Could not register null hot key");
             return(false);
         }
         return(RegisterHotKey(window.Handle, id, hotKey.ModifiersCode, hotKey.Code));
     }
     catch (Exception ex)
     {
         Log.Error(String.Format("Could not register hot key '{0}'", hotKey));
         Log.Exception(ex);
         return(false);
     }
 }
Example #4
0
 public bool Register(IWin32Window window, int id, IHotKeyCodeProvider hotKey)
 {
     try
     {
         if (window == null)
         {
             Log.Error("Could not register hot key for null window");
             return false;
         }
         if (hotKey == null)
         {
             Log.Error("Could not register null hot key");
             return false;
         }
         return RegisterHotKey(window.Handle, id, hotKey.ModifiersCode, hotKey.Code);
     }
     catch(Exception ex)
     {
         Log.Error(String.Format("Could not register hot key '{0}'", hotKey));
         Log.Exception(ex);
         return false;
     }
 }