/// <summary>
        /// Populates the specified menu bar with the layout of the given type.
        /// </summary>
        /// <param name="menubar">The menu bar to populate.</param>
        /// <param name="groupName">Name of the group.</param>
        public void Populate(
            MenuBar menubar,
            string groupName)
        {
            // Check the inputs.
            if (menubar == null)
            {
                throw new ArgumentNullException("menubar");
            }

            if (groupName == null)
            {
                throw new ArgumentNullException("groupName");
            }

            // Check our state.
            if (ActionManager == null)
            {
                throw new InvalidOperationException(
                          "Cannot populate a menubar unless ActionManager is set.");
            }

            // Get the group from the list.
            LayoutGroup group = groups[groupName];

            // Populate the menubar from the group.
            group.Populate(ActionManager, menubar);
        }