示例#1
0
        //------------------------------------------------------
        //
        //  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);
        }
示例#2
0
 internal static object ConvertToElementArray(object value)
 {
     // Convert each item to an AutomationElement...
     object[]            objArr = (object[])value;
     AutomationElement[] els    = new AutomationElement[objArr.Length];
     for (int i = 0; i < objArr.Length; i++)
     {
         if (objArr[i] == null)
         {
             els[i] = null;
         }
         else
         {
             SafeNodeHandle hnode = UiaCoreApi.UiaHUiaNodeFromVariant(objArr[i]);
             els[i] = AutomationElement.Wrap(hnode);
         }
     }
     return(els);
 }
示例#3
0
        private static object ConvertToElement(object value)
        {
            SafeNodeHandle hnode = UiaCoreApi.UiaHUiaNodeFromVariant(value);

            return(AutomationElement.Wrap(hnode));
        }