public StartupHandler(IScreens screensInfo, IVirtualDesktopCollection virtualDesktops, IContainerNodeCreater containerNodeCreator, IVirtualDesktopCreater virtualDesktopCreator, IScreenNodeCreater screenNodeCreator, ISignalHandler signal, IKeyHandler keyHandler, ICommandHelper commandHelper, IWindowTracker windowTracker, IPInvokeHandler pinvokeHandler) { this.screensInfo = screensInfo; this.desktops = virtualDesktops; this.containerNodeCreator = containerNodeCreator; this.signal = signal; this.keyHandler = keyHandler; this.commandHelper = commandHelper; this.windowTracker = windowTracker; this.pinvokeHandler = pinvokeHandler; this.HandlesToIgnore = new List <IntPtr>(); var result = screensInfo.AllScreens.GetOrderRect(); _screens = result.rect.ToArray(); for (var i = 0; i < desktops.Count; i++) { var screensToAdd = _screens.Select((rect, i) => screenNodeCreator.Create("Screen" + i, rect, dir: result.direction)).ToArray(); desktops[i] = virtualDesktopCreator.Create(i, rect: _screens.TotalRect(), dir: result.direction, childs: screensToAdd); desktops[i].Hide(); } desktops.Index = 0; desktops.ActiveDesktop.Show(); }
/// <summary> /// This method make sure we do actual init after desktop + screens have been added /// </summary> /// <param name="execute">something to run after init</param> private void DoInit(Action execute) { if (_haveInit) { execute?.Invoke(); return; } _haveInit = true; _parser = _services.GetRequiredService <MessageParser>(); _desktops = _services.GetRequiredService <IVirtualDesktopCollection>(); _parser.PostInit(); execute?.Invoke(); }
public CommandHelper(IVirtualDesktopCollection desktops, IPInvokeHandler pinvokeHandler, ICommandExecutor commandExecutor) { this.desktops = desktops; this.pinvokeHandler = pinvokeHandler; this.commandExecutor = commandExecutor; }
public void CreateDesktop(int desktops) { _desktops = new VirtualDesktopCollection(9); }