public void DoWork(object state) { using (AutomationElementFactory man = new AutomationElementFactory(pAutomation)) { ret = query(man); } ((AutoResetEvent)state).Set(); }
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; }
public void DoWork(object state) { try { using (AutomationElementFactory factory = new AutomationElementFactory(pAutomation)) { ret = query(factory); } } finally { ((AutoResetEvent)state).Set(); } }
internal AutomationElement(IUIAutomationElement pElement, AutomationElementFactory factory) { this.factory = factory; this.pElement = pElement; factory.AddToDisposeList(this); }