public AutomationElementCollection FindAll(TreeScope scope, Condition condition) { Utility.ValidateArgumentNonNull(condition, "condition"); try { UIAutomationClient.IUIAutomationElementArray elemArray = this._obj.FindAllBuildCache( (UIAutomationClient.TreeScope)scope, condition.NativeCondition, CacheRequest.CurrentNativeCacheRequest); return(AutomationElementCollection.Wrap(elemArray)); } catch (System.Runtime.InteropServices.COMException e) { Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; } } }
internal static AutomationElement[] ConvertToElementArray(UIAutomationClient.IUIAutomationElementArray array) { AutomationElement[] elementArray; if (array != null) { elementArray = new AutomationElement[array.Length]; for (int i = 0; i < array.Length; i++) { elementArray[i] = AutomationElement.Wrap(array.GetElement(i)); } } else { elementArray = null; } return(elementArray); }
internal static AutomationElementCollection Wrap(UIAutomationClient.IUIAutomationElementArray obj) { return((obj == null) ? null : new AutomationElementCollection(obj)); }
internal AutomationElementCollection(UIAutomationClient.IUIAutomationElementArray obj) { Debug.Assert(obj != null); this._obj = obj; }
internal AutomationElementCollectionEnumerator(UIAutomationClient.IUIAutomationElementArray obj) { Debug.Assert(obj != null); this._obj = obj; this._cElem = obj.Length; }