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); } } }
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); } } }
public override IUIAutomationCondition ToNative(IUIAutomation automation) => automation.CreateTrueCondition();