What is a primary control?

Nov 24, 2009 at 11:19 PM

I ask because the check for primary control in the UIItemCollection seems to be omitting controls that it should not:

 

public UIItemCollection(IEnumerable automationElements, ActionListener actionListener, Type customItemType)
        {
            foreach (AutomationElement automationElement in automationElements)
            {
                try
                {
                    if (!automationElement.IsPrimaryControl()) continue;
                    IUIItem uiItem = dictionaryMappedItemFactory.Create(automationElement, actionListener, customItemType);
                    if (uiItem != null) Add(uiItem);
                }
                catch (ControlDictionaryException)
                {
                    WhiteLogger.Instance.WarnFormat("Couldn't create UIItem for AutomationElement, {0}", automationElement.Display());
                }
            }
        }
Note the green code.  Is that a bug?  Should we make it optional to get back non-primary controls.  And the $64,000 question... what is a primary control?
Coordinator
Nov 29, 2009 at 6:16 AM

http://white.codeplex.com/wikipage?title=Object%20Structure

Primary UI items are items which you can retrieve from a window/panel (UIItemContainer) directly. Secondary UI Items are retrieved from Primary UI Items.