Exemple #1
0
        public static IUiElement PerformNavigateToLastChild(this IUiElement element)
        {
            IUiElement result = null;

            classic.TreeWalker walker = new classic.TreeWalker(classic.Condition.TrueCondition);

            try {
                result = AutomationFactory.GetUiElement(walker.GetLastChild(element.GetSourceElement() as classic.AutomationElement));
            } catch {
            }

            return(result);
        }
        public static IUiElement PerformNavigateToLastChild(this IUiElement element)
        {
            IUiElement result = null;

            classic.TreeWalker walker = new classic.TreeWalker(classic.Condition.TrueCondition);

            try {
                result = AutomationFactory.GetUiElement(walker.GetLastChild(element.GetSourceElement() as classic.AutomationElement));
            } catch {
            }

            return result;
        }
        protected void GetAutomationElementsChildren(IUiElement inputObject, bool firstChild)
        {
            if (!CheckAndPrepareInput(this))
            {
                return;
            }

            var walker =
                new classic.TreeWalker(
                    classic.Condition.TrueCondition);

            IUiElement sibling =
                firstChild ?
                AutomationFactory.GetUiElement(walker.GetFirstChild(inputObject.GetSourceElement() as classic.AutomationElement)) :
                AutomationFactory.GetUiElement(walker.GetLastChild(inputObject.GetSourceElement() as classic.AutomationElement));

            WriteObject(this, sibling);
        }
 protected void GetAutomationElementsChildren(IUiElement inputObject, bool firstChild)
 {
     if (!CheckAndPrepareInput(this)) { return; }
     
     var walker = 
         new classic.TreeWalker(
             classic.Condition.TrueCondition);
     
     IUiElement sibling =
         firstChild ?
             AutomationFactory.GetUiElement(walker.GetFirstChild(inputObject.GetSourceElement() as classic.AutomationElement)) :
                 AutomationFactory.GetUiElement(walker.GetLastChild(inputObject.GetSourceElement() as classic.AutomationElement));
     
     WriteObject(this, sibling);
 }