コード例 #1
0
        private AutomationElement ListItemElementFromPoint(AutomationElementFactory factory, Point pt)
        {
            if (PInvoke.WindowFromPoint(pt) != Handle)
            {
                return(null);
            }
            AutomationElement elem = factory.FromPoint(pt);

            if (elem == null)
            {
                return(null);
            }
            if (elem.GetClassName() == "UIItem")
            {
                return(elem);
            }
            elem = elem.GetParent();
            if (elem == null)
            {
                return(null);
            }
            if (elem.GetClassName() == "UIItem")
            {
                return(elem);
            }
            return(null);
        }
コード例 #2
0
 public override bool PointIsBackground(Point pt, bool screenCoords)
 {
     if (!screenCoords)
     {
         PInvoke.ClientToScreen(ListViewController.Handle, ref pt);
     }
     return(AutomationManager.DoQuery(factory => {
         AutomationElement elem = factory.FromPoint(pt);
         if (elem == null)
         {
             return false;
         }
         string className = elem.GetClassName();
         return className == "UIItemsView" || className == "UIGroupItem";
     }));
 }