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>(); }
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>(); }
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); } }
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; } }