private void DispatchOnScreen(List <IWindow> windows, IScreen screen) { var windowsCount = windows.Count; if (windowsCount > 0) { var totalWidth = screen.Rectangle.Size.Width; var width = (totalWidth - (windowsCount - 1) * 10) / windowsCount; for (int windowIndex = 0; windowIndex < windowsCount; windowIndex++) { var left = screen.Rectangle.Position.Left + (width + 10) * windowIndex; var top = screen.Rectangle.Position.Top; var height = screen.Rectangle.Size.Height; var rectangle = new Rectangle(width, height, left, top); var window = windows[windowIndex]; WindowOsServiceImpl.MoveSync(window, rectangle); this.LogLine("Moving window {0} to {1}", window.ToRepr(), rectangle.Canonical); } } }