/// <summary>
        /// 删除一个Ribbon页,以及其下所有分组和项
        /// </summary>
        /// <param name="id"></param>
        public void RemovePage(ToolStripPageEntity entity)
        {
            Debug.Assert(entity != null, "entity 为 null");

            if (entity == null)
            {
                return;
            }

            //查找其下所有分组,连带删除其下所有分组下的所有项
            ToolStripGroupEntityCollection groups = GetGroupCollection(entity.Id);

            foreach (var groupItem in groups)
            {
                RemoveGroup(groupItem);
            }

            //删除此页
            XElement element = _indexXml.XPathSelectElement(String.Format(XPATH_Index_SelectPage, entity.Id));

            if (element != null)
            {
                element.Remove();
            }

            SaveIndexFile();

            ToolStripPageEventArgs args = new ToolStripPageEventArgs(entity);

            _eventAggregator.GetEvent <ToolStripPageRemovedEvent>().Publish(args);
        }
        /// <summary>
        /// 添加一个Ribbon页
        /// </summary>
        /// <param name="pageEntity"></param>
        public void AddPage(ToolStripPageEntity entity)
        {
            Debug.Assert(entity != null, "entity 为 null");

            if (entity == null)
            {
                return;
            }

            //添加索引信息
            _indexXml.XPathSelectElement(XPATH_Index_Pages).Add(XElement.Parse(entity.ToXml()));

            SaveIndexFile();

            //发布事件
            ToolStripPageEventArgs args = new ToolStripPageEventArgs(entity);

            _eventAggregator.GetEvent <ToolStripPageAddedEvent>().Publish(args);
        }
        public void UpdatePage(ToolStripPageEntity entity)
        {
            Debug.Assert(entity != null, "ToolStripPageEntity 为 null");

            if (entity == null)
            {
                return;
            }

            //更新索引信息
            XElement element = _indexXml.XPathSelectElement(String.Format(XPATH_Index_SelectPage, entity.Id));

            Debug.Assert(element != null, "更新窗体文件夹索引时未找到指定文件夹的索引记录");
            if (element != null)
            {
                element.ReplaceWith(XElement.Parse(entity.ToXml()));
                SaveIndexFile();

                //发布事件
                ToolStripPageEventArgs args = new ToolStripPageEventArgs(entity);
                _eventAggregator.GetEvent <ToolStripPageUpdatedEvent>().Publish(args);
            }
        }