public static void RemoveRibbonButton(Ribbon ribbon, RibbonModulePluginItem modulePluginItem)
        {
            if (ribbon == null)
            {
                return;
            }

            RibbonTab ribbonTab = RibbonHelper.FindRibbonTab(ribbon, modulePluginItem.Navigation.Text);

            if (ribbonTab == null)
            {
                return;
            }

            RibbonItem ribbonItem = RibbonHelper.FindRibbonItem(ribbon,
                                                                modulePluginItem.Navigation.Text,
                                                                modulePluginItem.Name);

            if (ribbonItem == null)
            {
                return;
            }

            int panelIndex = modulePluginItem.Alignment == RibbonButtonAlignment.Right ? 1 : 0;

            ribbonTab.Panels[panelIndex].Items.Remove(ribbonItem);
        }
        public static void AddRibbonButton(Ribbon ribbon,
                                           string tabText,
                                           string buttonName,
                                           string text,
                                           Image image,
                                           string tooltip,
                                           bool enable,
                                           bool isChecked,
                                           RibbonButtonAlignment alignment,
                                           EventHandler clickHandler)
        {
            if (ribbon == null)
            {
                return;
            }

            RibbonItem ribbonItem = null;

            if (RibbonModulePluginProvider.Ribbon_Separator.Equals(buttonName))
            {
                ribbonItem = new RibbonSeparator();
            }
            else
            {
                ribbonItem         = new RibbonButton();
                ribbonItem.Text    = text;
                ribbonItem.Image   = image;
                ribbonItem.ToolTip = tooltip;
                ribbonItem.Enabled = enable;
                ribbonItem.Checked = isChecked;
                ribbonItem.Click  += new EventHandler(clickHandler);
            }

            ribbonItem.Name = buttonName;

            RibbonTab ribbonTab = RibbonHelper.FindRibbonTab(ribbon, tabText);

            if (ribbonTab == null)
            {
                return;
            }

            int panelIndex = alignment == RibbonButtonAlignment.Right ? 1 : 0;

            ribbonTab.Panels[panelIndex].Items.Add(ribbonItem);
        }