in src/Desktop/UIAutomation/A11yAutomation.cs [297:328]
public static A11yElement NormalizedElementFromPoint(int xPos, int yPos, TreeViewMode treeViewMode)
{
try
{
A11yElement element = ElementFromPoint(xPos, yPos);
if (element == null)
return null;
if (treeViewMode == TreeViewMode.Raw)
return element;
if (treeViewMode == TreeViewMode.Control && element.IsControlElement)
return element;
if (treeViewMode == TreeViewMode.Content && element.IsContentElement)
return element;
using (element)
{
return GetNormalizedElement(element, treeViewMode);
}
}
#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception e)
{
e.ReportException();
}
#pragma warning restore CA1031 // Do not catch general exception types
return null;
}