SelectionItemPattern( AutomationElement element, IUIAutomationSelectionItemPattern selectionItemPattern) : base(el: element) { this._selectionItemPattern = selectionItemPattern; }
public bool IsSelected() { object obj; pElement.GetCurrentPattern(UIA_SelectionItemPatternId, out obj); try { if (obj == null) { return(false); } IUIAutomationSelectionItemPattern selprov = obj as IUIAutomationSelectionItemPattern; bool ret; selprov.get_CurrentIsSelected(out ret); return(ret); } catch (COMException) { return(false); } finally { if (obj != null) { Marshal.ReleaseComObject(obj); } } }
/// <summary> /// SelectionItemPattern.Select method. Used for Radio Buttons, Tabs so far. /// </summary> /// <param name="element"></param> /// <returns></returns> public static IUIAutomationElement xtSelectItem(this IUIAutomationElement element) { _SelectionItemPattern = (IUIAutomationSelectionItemPattern)element.GetCurrentPattern(UIA_PatternIds.UIA_SelectionItemPatternId); if (!element.xtIsItemSelected()) { _SelectionItemPattern.Select(); } return(element); }
protected override void Dispose(bool disposing) { if (Pattern != null) { System.Runtime.InteropServices.Marshal.ReleaseComObject(Pattern); this.Pattern = null; } base.Dispose(disposing); }
private SelectionItemPattern(AutomationElement el, IUIAutomationSelectionItemPattern pattern, bool cached) : base(el, cached) { Debug.Assert(pattern != null); this._pattern = pattern; }
internal static SelectionItemPattern Wrap( AutomationElement element, IUIAutomationSelectionItemPattern selectionItemPattern) { return(new SelectionItemPattern(element: element, selectionItemPattern: selectionItemPattern)); }
public UiAutomationSelectHint(IntPtr owningWindow, IUIAutomationSelectionItemPattern selectPattern, Rect boundingRectangle) : base(owningWindow, boundingRectangle) { _selectPattern = selectPattern; }
public SelectionItemPattern(A11yElement e, IUIAutomationSelectionItemPattern p) : base(e, PatternType.UIA_SelectionItemPatternId) { Pattern = p; PopulateProperties(); }
public SelectionItemPattern(IUIAutomationElement element, bool canSelectMultiple = false) { _canSelectMultiple = canSelectMultiple; _selectionItemPattern = element.GetCurrentPattern(UIA_PatternIds.UIA_SelectionItemPatternId) as IUIAutomationSelectionItemPattern; }
public static bool xtIsItemSelected(this IUIAutomationElement element) { _SelectionItemPattern = (IUIAutomationSelectionItemPattern)element.GetCurrentPattern(UIA_PatternIds.UIA_SelectionItemPatternId); return(_SelectionItemPattern.CurrentIsSelected == 1); // CurrentIsSelected returns int 0 or 1 for binary true/false }