/// <summary> /// Initializes a new instance of the <see cref="WindowManagerService"/> class. /// </summary> /// <param name="platformFacade">Instance of the Platform implementation facade</param> /// <param name="notificationService">Instance of Notification Service</param> public WindowManagerService(IPlatformFacade platformFacade, INotificationService notificationService) { this.platformFacade = platformFacade; this.notificationService = notificationService; this.ManagedWindows = new Dictionary<IntPtr, Window>(); this.Frames = new List<Frame>(); }
public ReadkeyCommandTests() { this.platformFacade = Substitute.For<IPlatformFacade>(); this.platformFacade.RegisterHotKey(Keys.None, 0).ReturnsForAnyArgs(true); this.keyMapService = new KeyMapService(this.platformFacade); this.mainWindow = Substitute.For<IMainWindow>(); }
public NavigationService( ILoggingService loggingService, IViewModelFactory viewModelFactory, IViewFactory viewFactory, INavigationFacade navigationFacade, IPlatformFacade platformFacade) { _loggingService = loggingService; _viewModelFactory = viewModelFactory; _viewFactory = viewFactory; _navigationFacade = navigationFacade; _platformFacade = platformFacade; }
/// <summary> /// Initializes a new instance of the <see cref="MainWindow"/> class. /// </summary> /// <param name="platformFacade">Platform implementation.</param> /// <param name="keyMapService"> /// The key map service. /// </param> /// <param name="windowManagerService"> /// The window manager service. /// </param> public MainWindow(IPlatformFacade platformFacade, IKeyMapService keyMapService, IWindowManagerService windowManagerService) { platformFacade.MainWindow = this; this.keyMapService = keyMapService; this.windowManagerService = windowManagerService; WM_SHELLHOOK = Interop.RegisterWindowMessage("SHELLHOOK"); this.AllowTransparency = true; this.BackColor = Color.DarkGray; this.Cursor = Cursors.NoMove2D; this.FormBorderStyle = FormBorderStyle.None; this.KeyPreview = true; this.Opacity = 0.3; this.ShowInTaskbar = false; this.WindowState = FormWindowState.Minimized; this.Activated += this.MainWindowActivated; }
public DefinekeyCommandTests() { this.platformFacade = Substitute.For<IPlatformFacade>(); this.keyMapService = new KeyMapService(this.platformFacade); var commandStub = new ICommandStub { Args = "arg1", Name = "testCommand", Help = "sample help!" }; var commandHandlerStub = new ICommandHandlerStub { ExpectedCommandArgs = commandStub.Args, ExpectedCommandName = commandStub.Name, ExpectedCommandHelp = commandStub.Help, ExpectedExecuteResult = () => true }; this.commandService = new CommandService( new List<ICommand> { commandStub }, new List<object> { commandHandlerStub }); }
public NewKMapCommandTests() { this.platformFacade = NSubstitute.Substitute.For<IPlatformFacade>(); this.keyMapService = new KeyMapService(this.platformFacade); }
public void SetupTest() { var mainWindow = Substitute.For<IMainWindow>(); mainWindow.GetHandle().Returns(IntPtr.Zero); this.platformFacade = Substitute.For<IPlatformFacade>(); this.platformFacade.MainWindow.Returns(mainWindow); this.platformFacade.RegisterHotKey(Keys.A, 0).ReturnsForAnyArgs(true); this.platformFacade.UnregisterHotKey(0).ReturnsForAnyArgs(true); this.keyMapService = new KeyMapService(this.platformFacade); (this.keyMapService as ServiceBase).Start(); this.keyMapService.AddKeyMap(TestKeyMapName); }
public DelKMapCommandTests() { this.platformFacade = Substitute.For<IPlatformFacade>(); this.platformFacade.UnregisterHotKey(0).ReturnsForAnyArgs(true); this.keyMapService = new KeyMapService(this.platformFacade); }
/// <summary> /// Initializes a new instance of the <see cref="KeyMapService"/> class. /// </summary> /// <param name="platformFacade"> /// An <see cref="IPlatformFacade"/> implementation /// </param> public KeyMapService(IPlatformFacade platformFacade) { this.nameToKeyMapMapping = new Dictionary<string, KeyMap>(); this.topKeyToKeyMapMapping = new Dictionary<Keys, KeyMap>(); this.platformFacade = platformFacade; }