Exemplo n.º 1
0
        public VirtualScreen GetFurthestLeft()
        {
            VirtualScreen furthestLeft = null;
            var           minX         = double.MaxValue;

            foreach (var s in Screens.Values.SelectMany(x => x))
            {
                var minForThisScreen = s.X;
                if (minForThisScreen < minX)
                {
                    minX         = minForThisScreen;
                    furthestLeft = s;
                }
            }

            return(furthestLeft);
        }
Exemplo n.º 2
0
        public VirtualScreen GetFurthestRight()
        {
            VirtualScreen furthestRight = null;
            var           maxX          = double.MinValue;

            foreach (var s in Screens.Values.SelectMany(x => x))
            {
                var maxForThisScreen = s.X + s.Width;
                if (maxForThisScreen > maxX)
                {
                    maxX          = maxForThisScreen;
                    furthestRight = s;
                }
            }

            return(furthestRight);
        }
Exemplo n.º 3
0
        public bool Start()
        {
            _connection.Start();
            _hook.Init();

            //there is some kind of dpi awareness bug here on windows. not sure exactly what's up.
            VirtualScreen s = null;

            foreach (var display in _hook.GetDisplays())
            {
                s = ClientState.ScreenConfiguration.AddScreen(display.X, display.Y, display.X, display.Y, display.Width, display.Height, ClientState.ClientName, "");
            }
            _dispatcher.ClientCheckin(ClientState.ClientName, ClientState.ScreenConfiguration.Screens.Values.SelectMany(x => x).ToList());
            _hook.Hook.SetMousePos(ClientState._lastPositionX, ClientState._lastPositionY);
            _hook.Start();

            return(true);
        }
Exemplo n.º 4
0
 public VirtualScreen AddScreenBelow(VirtualScreen orig, double localX, double localY, double width, double height, string client, string connectionId)
 {
     return(AddScreen(localX, localY, orig.X, orig.Y + orig.Height, width, height, client, connectionId));
 }