///
        protected override List <AutomationPeer> GetChildrenCore()
        {
            RibbonGallery         owner = (RibbonGallery)Owner;
            List <AutomationPeer> baseAutomationPeers = new List <AutomationPeer>();

            if (!owner.IsGrouping)
            {
                baseAutomationPeers = base.GetChildrenCore();
            }


            if (owner.CanUserFilter)
            {
                UIElement filterHost = null;
                if (owner.FilterPaneContent != null || owner.FilterPaneContentTemplate != null)
                {
                    filterHost = owner.FilterContentPane;
                }
                else
                {
                    filterHost = owner.FilterMenuButton;
                }

                if (filterHost != null)
                {
                    baseAutomationPeers.Add(RibbonHelper.CreatePeer(filterHost));
                }
            }

            return(baseAutomationPeers);
        }
Exemplo n.º 2
0
        /// <summary>
        ///  Creates peers for AuxiliaryPaneContent and FooterPanecontent and add them to the
        ///  collection of children peers.
        /// </summary>
        /// <returns></returns>
        protected override List <AutomationPeer> GetChildrenCore()
        {
            List <AutomationPeer> children = base.GetChildrenCore();
            RibbonApplicationMenu menu     = Owner as RibbonApplicationMenu;
            UIElement             element  = menu.FooterPaneHost;

            if (element != null)
            {
                if (children == null)
                {
                    children = new List <AutomationPeer>();
                }
                children.Add(RibbonHelper.CreatePeer(element));
            }

            element = menu.AuxiliaryPaneHost;
            if (element != null)
            {
                if (children == null)
                {
                    children = new List <AutomationPeer>();
                }
                children.Add(RibbonHelper.CreatePeer(element));
            }

            return(children);
        }
        ///
        protected override List <AutomationPeer> GetChildrenCore()
        {
            RibbonGallery         owner    = (RibbonGallery)Owner;
            List <AutomationPeer> children = null;

#if IN_RIBBON_GALLERY
            // If this is an InRibbonGallery, then we do not want the filter peer or the
            // RibbonGalleryCategory peers in the tree.  Add only the RibbonGalleryItem peers.
            if (owner.ParentInRibbonGallery != null &&
                owner.ParentInRibbonGallery.IsInInRibbonMode)
            {
                foreach (AutomationPeer categoryPeer in base.GetChildrenCore())
                {
                    foreach (AutomationPeer itemPeer in categoryPeer.GetChildren())
                    {
                        if (children == null)
                        {
                            children = new List <AutomationPeer>();
                        }

                        children.Add(itemPeer);
                    }
                }

                return(children);
            }
#endif

            if (!owner.IsGrouping)
            {
                children = base.GetChildrenCore();
            }

            if (owner.CanUserFilter)
            {
                UIElement filterHost = null;
                if (owner.FilterPaneContent != null || owner.FilterPaneContentTemplate != null)
                {
                    filterHost = owner.FilterContentPane;
                }
                else
                {
                    filterHost = owner.FilterMenuButton;
                }

                if (filterHost != null)
                {
                    if (children == null)
                    {
                        children = new List <AutomationPeer>(1);
                    }

                    children.Insert(0, RibbonHelper.CreatePeer(filterHost));
                }
            }

            return(children);
        }