/// ------------------------------------------------------------------- /// <summary></summary> /// ------------------------------------------------------------------- internal SelectionItemPatternWrapper(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands) : base(element, testSuite, priority, typeOfControl, typeOfPattern, dirResults, testEvents, commands) { _pattern = (SelectionItemPattern)GetPattern(m_le, m_useCurrent, SelectionItemPattern.Pattern); if (_pattern == null) throw new Exception(Helpers.PatternNotSupported + ": SelectionItemPattern"); _selectionContainer = _pattern.Current.SelectionContainer; if (_selectionContainer != null) { _selectionPattern = _selectionContainer.GetCurrentPattern(SelectionPattern.Pattern) as SelectionPattern; if (_selectionPattern == null) throw new ArgumentException("Could not find the SelectionContainer's SelectionPattern"); } }
public static bool TrySelectItem(this AutomationElement el) { object selectionItem; if (el.TryGetCurrentPattern(SelectionItemPattern.Pattern, out selectionItem)) { try { SelectionItemPattern item = (SelectionItemPattern)selectionItem; item.Select(); return(true); } catch { return(false); } } return(false); }
public GuiComboBoxItem(AutomationElement item) { _cmbItem = item; _selection = _cmbItem.GetPattern<SelectionItemPattern>(SelectionItemPattern.Pattern); }
internal SelectionItemPatternInformation(SelectionItemPattern pattern, bool cache) { this.pattern = pattern; this.cache = cache; }
private GuiTabItem(AutomationElement ti, string automationId) { Window = ti; _selection = Window.GetPattern<SelectionItemPattern>(SelectionItemPattern.Pattern); AutomationId = automationId; }
public void VerifyIsCurrentTab() { _selection = Window.GetPattern<SelectionItemPattern>(SelectionItemPattern.Pattern); Assert.IsTrue(_selection.Current.IsSelected); }
internal SelectionItemPatternInformation (SelectionItemPattern pattern, bool cache) { this.pattern = pattern; this.cache = cache; }
/// ------------------------------------------------------------------- /// <summary></summary> /// ------------------------------------------------------------------- public SelectionItemTests(AutomationElement element, TestPriorities priority, string dirResults, bool testEvents, TypeOfControl typeOfControl, IApplicationCommands commands) : base(element, TestSuite, priority, typeOfControl, TypeOfPattern.SelectionItem, dirResults, testEvents, commands) { _pattern = (SelectionItemPattern)element.GetCurrentPattern(SelectionItemPattern.Pattern); if (_pattern == null) throw new Exception(Helpers.PatternNotSupported); }