Пример #1
0
        protected ScrollBar(AutomationElement automationElement, IActionListener actionListener, ScrollBarButtonAutomationIds automationIds)
            : base(automationElement, actionListener)
        {
            this.automationIds = automationIds;
            var finder = new AutomationElementFinder(automationElement);

            primaryUIItemFactory = new PrimaryUIItemFactory(finder);
        }
Пример #2
0
 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));
 }
Пример #3
0
 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;
     }
 }
Пример #4
0
 /// <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);
     }
 }
Пример #5
0
 public NonCachedContainerItemFactory(PrimaryUIItemFactory factory, ActionListener actionListener)
 {
     this.factory        = factory;
     this.actionListener = actionListener;
 }