Exemplo n.º 1
0
        /// <summary>
        ///     Executes the specified action using a pattern for all components in this collection.
        /// </summary>
        /// <typeparam name="T">The type of the pattern.</typeparam>
        /// <param name="actions">The actions to execute.</param>
        /// <returns>This UI component collection.</returns>
        public UIComponents Execute <T>(Action <T> actions) where T : BasePattern
        {
            foreach (var component in Components)
            {
                actions(AutomationElementHelper.GetPattern <T>(component.Element));
            }

            return(this);
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Executes the specified action using a pattern for this component.
 /// </summary>
 /// <typeparam name="T">The type of the pattern.</typeparam>
 /// <param name="actions">The actions to execute.</param>
 /// <returns>This UI component.</returns>
 public UIComponent Execute <T>(Action <T> actions) where T : BasePattern
 {
     actions(AutomationElementHelper.GetPattern <T>(Element));
     return(this);
 }
Exemplo n.º 3
0
 /// <summary>
 ///     Get the specified pattern for this component.
 /// </summary>
 /// <typeparam name="T">The type of the pattern.</typeparam>
 /// <returns>The pattern.</returns>
 public T Pattern <T>() where T : BasePattern
 {
     return(AutomationElementHelper.GetPattern <T>(Element));
 }