Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public virtual void RegisterRibbonButtonClickCommand(string modulePluginCommandName, EventHandler clickHandler)
        {
            RibbonItem ribbonButton = RibbonHelper.FindRibbonItem(this.RibbonMenu, modulePluginCommandName);

            if (ribbonButton == null)
            {
                return;
            }

            ribbonButton.Click += clickHandler;
        }