private void HandleQueryInner(Query query)
        {
            using (query)
            {
                var updateInteractors = false;
                lock (_lock)
                {
                    if (_interactorsHaveChanged)
                    {
                        updateInteractors       = true;
                        _interactorsHaveChanged = false;
                    }
                }

                System.Windows.Rect queryRect;
                if (!TryGetQueryRectangle(query, out queryRect))
                {
                    return;
                }

                foreach (var window in GetWindowsWithInteractors())
                {
                    if (updateInteractors)
                    {
                        WpfCrawler.UpdateInteractorProperties(window, Literals.RootId);
                    }

                    if (query.WindowIds.Contains(GetWindowId(window)))
                    {
                        var interactorElements = WpfCrawler.GetInteractors(window, queryRect);
                        SendQueryReply(query, interactorElements);
                    }
                }
            }
        }
Esempio n. 2
0
 private static ScrollViewer GetScrollViewer(FrameworkElement element)
 {
     return(element as ScrollViewer ?? WpfCrawler.GetFirstChildOfType <ScrollViewer>(element));
 }