示例#1
1
 public ViewTree(IUIAutomationElement element, IUIAutomation automation)
 {
     this.root = new TreeNode(element);
     this.root.parent = null;
     IUIAutomationElementArray array = element.FindAll(TreeScope.TreeScope_Children, automation.CreateTrueCondition());
     if (0 == array.Length)
     {
         this.root.children = null;
         this.root.isLeaf = true;
     }
     else
     {
         for (int i = 0; i < array.Length; i++)
         {
             IUIAutomationElement e = array.GetElement(i);
             TreeNode n = new TreeNode(e);
             this.root.children.Add(n);
         }
     }
 }
示例#2
0
        public ViewTree(IUIAutomationElement element, IUIAutomation automation)
        {
            this.root        = new TreeNode(element);
            this.root.parent = null;
            IUIAutomationElementArray array = element.FindAll(TreeScope.TreeScope_Children, automation.CreateTrueCondition());

            if (0 == array.Length)
            {
                this.root.children = null;
                this.root.isLeaf   = true;
            }
            else
            {
                for (int i = 0; i < array.Length; i++)
                {
                    IUIAutomationElement e = array.GetElement(i);
                    TreeNode             n = new TreeNode(e);
                    this.root.children.Add(n);
                }
            }
        }
示例#3
0
 public override IUIAutomationCondition ToNative(IUIAutomation automation) => automation.CreateTrueCondition();