Ejemplo n.º 1
0
        internal string GetContainerCSSClassName()
        {
            // Get the correct CSS for whether this tab is contextual or not
            string className = "ms-cui-tabContainer";

            if (Contextual)
            {
                className += " ms-cui-tabContainer-" + ContextualGroup.GetColorNameForContextualTabColor(
                    Ribbon.GetContextualGroup(ContextualGroupId).Color);
            }

            return(className);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a ContextualGroup to this ribbon
        /// </summary>
        /// <param name="id">The id of the ContextualGroup.</param>
        /// <param name="title">The Title of the ContextualGroup.</param>
        /// <param name="color">The color of the ContextualGroup.</param>
        public void AddContextualGroup(string id, string title, ContextualColor color, string command)
        {
            ContextualGroup cg = GetContextualGroup(id);
            if (!CUIUtility.IsNullOrUndefined(cg))
            {
                throw new ArgumentException("A contextual group with id: " + id +
                                       " has already been added to this ribbon.");
            }

            cg = new ContextualGroup(id, title, color, command);
            _contextualGroups[id] = cg;
        }