//------------------------------------------------------ // // Public Properties // //------------------------------------------------------ #region Public Properties /// <summary> /// Retrieves a collection of all of the children that fall within the /// range. /// </summary> /// <returns>A collection of all children that fall within the range. Children /// that overlap with the range but are not entirely enclosed by it will /// also be included in the collection.</returns> public AutomationElement[] GetChildren() { object[] rawChildren = UiaCoreApi.TextRange_GetChildren(_hTextRange); AutomationElement[] wrappedChildren = new AutomationElement[rawChildren.Length]; for (int i = 0; i < rawChildren.Length; i++) { SafeNodeHandle hnode = UiaCoreApi.UiaHUiaNodeFromVariant(rawChildren[i]); wrappedChildren[i] = AutomationElement.Wrap(hnode); } return(wrappedChildren); }