public AutomationElement FindItemByProperty(AutomationElement startAfter, AutomationProperty property, object value) { try { return(AutomationElement.Wrap( this._pattern.FindItemByProperty( (startAfter == null) ? null : startAfter.NativeElement, (property == null) ? 0 : property.Id, Utility.UnwrapObject(value)))); } catch (System.Runtime.InteropServices.COMException e) { Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; } } }
public static AutomationElement FromPoint(Point pt) { try { UIAutomationClient.IUIAutomationElement element = Automation.Factory.ElementFromPointBuildCache( Utility.PointManagedToNative(pt), CacheRequest.CurrentNativeCacheRequest); return(AutomationElement.Wrap(element)); } catch (System.Runtime.InteropServices.COMException e) { Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; } } }
public AutomationElement GetLastChild(AutomationElement element, CacheRequest request) { Utility.ValidateArgumentNonNull(element, "element"); Utility.ValidateArgumentNonNull(request, "request"); try { return(AutomationElement.Wrap(this._obj.GetLastChildElementBuildCache( element.NativeElement, request.NativeCacheRequest))); } catch (System.Runtime.InteropServices.COMException e) { Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; } } }
public AutomationElement FindFirst(TreeScope scope, Condition condition) { Utility.ValidateArgumentNonNull(condition, "condition"); try { UIAutomationClient.IUIAutomationElement elem = this._obj.FindFirstBuildCache( (UIAutomationClient.TreeScope)scope, condition.NativeCondition, CacheRequest.CurrentNativeCacheRequest); return(AutomationElement.Wrap(elem)); } catch (System.Runtime.InteropServices.COMException e) { Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; } } }
private static object ConvertToElement(object value) { return(AutomationElement.Wrap((UIAutomationClient.IUIAutomationElement)value)); }