Example #1
0
        private void ProcessSplitButtonMRUNode(RibbonPanel panel, XmlNode node)
        {
            bool?  useLargeIcon  = XmlUtilities.GetAttributeValueAsNullable <bool>(node, "useLargeIcon");
            bool?  showText      = XmlUtilities.GetAttributeValueAsNullable <bool>(node, "showText");
            string targetControl = XmlUtilities.GetAttributeValue <string>(node, "targetControl");
            bool?  insertBefore  = XmlUtilities.GetAttributeValueAsNullable <bool>(node, "insertBefore");
            bool?  isInSlideout  = XmlUtilities.GetAttributeValueAsNullable <bool>(node, "isInSlideout");

            bool slideout = isInSlideout.HasValue ? isInSlideout.Value : false;

            CommandControls controls = (slideout ? panel.SlideoutControls : panel.CommandControls);

            ObjectCollection buttons = GetButtons(node);

            if (buttons.Count > 0)
            {
                controls.AddSplitButtonMRU(
                    buttons,
                    useLargeIcon.HasValue ? useLargeIcon.Value : false,
                    showText.HasValue ? showText.Value : true,
                    string.IsNullOrEmpty(targetControl) ? string.Empty : targetControl,
                    insertBefore.HasValue ? insertBefore.Value : false);
            }
        }