コード例 #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
        //------------------------------------------------------
        //
        //  Public Methods
        //
        //------------------------------------------------------

        #region Public Methods
        /// <summary>
        /// Obtain the AutomationElement at an zero based absolute position in the grid.
        /// Where 0,0 is top left
        /// </summary>
        /// <param name="row">Row of item to get</param>
        /// <param name="column">Column of item to get</param>
        ///
        /// <outside_see conditional="false">
        /// This API does not work inside the secure execution environment.
        /// <exception cref="System.Security.Permissions.SecurityPermission"/>
        /// </outside_see>
        public AutomationElement GetItem(int row, int column)
        {
            SafeNodeHandle hNode = UiaCoreApi.GridPattern_GetItem(_hPattern, row, column);

            return(AutomationElement.Wrap(hNode));
        }