protected ScrollBar(AutomationElement automationElement, IActionListener actionListener, ScrollBarButtonAutomationIds automationIds) : base(automationElement, actionListener) { this.automationIds = automationIds; var finder = new AutomationElementFinder(automationElement); primaryUIItemFactory = new PrimaryUIItemFactory(finder); }
public UIItem(AutomationElement automationElement, IActionListener actionListener) { if (null == automationElement) { throw new NullReferenceException(); } this.automationElement = automationElement; this.actionListener = actionListener ?? new NullActionListener(); factory = new PrimaryUIItemFactory(new AutomationElementFinder(automationElement)); }
public CurrentContainerItemFactory(PrimaryUIItemFactory primaryUIItemFactory, InitializeOption initializeOption, AutomationElement automationElement, ActionListener listener) { this.automationElement = automationElement; actionListener = listener; current = nonCachedContainerItemFactory = new NonCachedContainerItemFactory(primaryUIItemFactory, actionListener); if (initializeOption.Cached) { cachedContainerItemFactory = CreateCacheFactory(initializeOption); current = cachedContainerItemFactory; } }
/// <summary> /// Retrieves a White element using RawElementBasedSearch with the given MaxElementSearchDepth, which can be much faster than a normal search for large control trees. /// </summary> public static T RawGet <T>(this AutomationElement element, SearchCriteria criteria, int searchDepth) where T : UIItem { using (CoreAppXmlConfiguration.Instance.ApplyTemporarySetting(config => { config.RawElementBasedSearch = true; config.MaxElementSearchDepth = searchDepth; })) { var l = new NullActionListener(); var t = typeof(T); var factory = new PrimaryUIItemFactory(new AutomationElementFinder(element)); var e = factory.Create(criteria, l); return(e as T); } }
public NonCachedContainerItemFactory(PrimaryUIItemFactory factory, ActionListener actionListener) { this.factory = factory; this.actionListener = actionListener; }