Пример #1
0
        public void Start(ClientSession clientSession, Window parentWindow, string hierarchyKind)
        {
            if (mouseListener.Enabled)
            {
                return;
            }

            this.clientSession = clientSession;
            this.hierarchyKind = hierarchyKind;

            if (overlayWindow == null)
            {
                overlayWindow = new ViewHighlightOverlayWindow {
                    Owner         = parentWindow,
                    ShowActivated = true,
                    WindowState   = WindowState.Maximized,
                };
                // Prevent closing by user (with alt+F4, for example)
                overlayWindow.Closing += (o, a) => a.Cancel = !isDisposed;
            }
            overlayWindow.Show();

            CancelHighlightOnMove();
            highlightOnMoveCts = new CancellationTokenSource();

            coordinateMapper      = AgentCoordinateMapper.Create(clientSession.Agent.Identity, parentWindow);
            mouseListener.Enabled = true;
        }
Пример #2
0
        public void Start()
        {
            mouseMonitor?.Dispose();

            CancelHighlightOnMove();
            highlightOnMoveCts = new CancellationTokenSource();

            switch (clientSession.Agent.Type)
            {
            case AgentType.iOS:
                coordinateMapper = new iOSSimulatorCoordinateMapper(clientSession.Agent.Identity);
                break;

            case AgentType.Android:
                coordinateMapper = new MacAndroidCoordinateMapper(clientSession.Agent.Identity);
                break;

            default:
                coordinateMapper = new MacCoordinateMapper();
                break;
            }

            mouseMonitor             = new MouseMonitor();
            mouseMonitor.MouseMoved += MouseMonitor_MouseMoved;
            mouseMonitor.MouseUp    += MouseMonitor_MouseUp;
        }