public void SelectNode(string itemText) { LogText = "Item: " + itemText; try { RegisterEvent(SelectionItemPattern.ElementSelectedEvent); AutomationElement control = SelectionPatternHelper.FindItemByText(UIAElement, itemText); SelectionPatternHelper.Select(control); } catch (ProdOperationException err) { throw; } }
public void SelectNode(int index) { LogText = "Index: " + index; try { RegisterEvent(SelectionItemPattern.ElementSelectedEvent); AutomationElement indexedItem = SelectionPatternHelper.FindItemByIndex(UIAElement, index); SelectionPatternHelper.Select(indexedItem); } catch (ProdOperationException err) { throw; } }