Пример #1
0
        private AutomationElement FindWindowElement(Process process, Predicate <string> match)
        {
            BricksCollection <AutomationElement> elements = FindAllWindowElements(process);

            return(elements.Find(delegate(AutomationElement obj)
            {
                if (match.Invoke(obj.Current.Name))
                {
                    return true;
                }

                AutomationElement titleBarElement =
                    new AutomationElementFinder(obj).Child(AutomationSearchCondition.ByControlType(ControlType.TitleBar));
                if (titleBarElement == null)
                {
                    return false;
                }
                return match.Invoke(titleBarElement.Current.Name);
            }));
        }
Пример #2
0
 public virtual ScreenRepository Repository(Application application)
 {
     return(screenRepositories.Find(delegate(ScreenRepository obj) { return obj.IsForApplication(application); }));
 }