public static void AddRibbonGroup() { rgAMU = new RibbonGroup("rgAMU", "AMU"); galleryAMU = new CommandBarGalleryPopup("AutoMarkUp Tool"); galleryAMU.NumberOfColumns = 6; galleryAMU.GalleryTextPosition = GalleryTextPosition.Below; galleryAMU.GalleryItemSize = new Size(96, 96); //galleryEB.Image = Resources.EquipmentBuilder; //galleryAMU.HelpText = "For creating station equipment."; CommandBarHeader control = new CommandBarHeader("Marks"); galleryAMU.GalleryControls.Add(control); btnAMU = new CommandBarButton("AutoMarkUp", "AutoMarkUp"); //btnFB.Image = Resources.NetFence_96x96; galleryAMU.GalleryControls.Add(btnAMU); UIEnvironment.RibbonTabs["Modeling"].Groups[0].Controls.Insert(8, galleryAMU); btnAMU.UpdateCommandUI += btnAMU_UpdateCommandUI; btnAMU.ExecuteCommand += btnAMU_ExecuteCommand; ToolControlManager.RegisterToolCommand("AutoMarkUp", ToolControlManager.FindToolHost("ElementBrowser")); }
private static void btnAMU_ExecuteCommand(object sender, ExecuteCommandEventArgs e) { ToolControlManager.ShowTool(typeof(frmAutoMarkUpBuilder), e.Id); }