public void Select()
{
try
{
this._pattern.Select();
}
catch (System.Runtime.InteropServices.COMException e)
{
Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
}
}
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); }