System.Windows.Automation.SelectionItemPattern.Select C# (CSharp) Méthode

Select() public méthode

public Select ( ) : void
Résultat void
        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; }
            }
        }

Usage Example

Exemple #1
0
        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);
        }