public void ShowForm(UIApplication uiapp, List <Room> roomList) { if (formDialog == null || formDialog.IsDisposed) { CommandHandler handler = new CommandHandler(); ExternalEvent exEvent = ExternalEvent.Create(handler); formDialog = new Calculating(exEvent, handler, roomList); formDialog.Show(); } }
public Result OnStartup(UIControlledApplication app) { formDialog = null; thisApp = this; string tabName = "Отделка помещений"; string panelName = "Отделка"; app.CreateRibbonTab(tabName); var panel = app.CreateRibbonPanel(tabName, panelName); var NewButton = new PushButtonData("Отделка", "Отделка", Assembly.GetExecutingAssembly().Location, "Kursach.Command"); var NewButon = panel.AddItem(NewButton) as PushButton; Image img = Properties.Resources.Screenshot_1; ImageSource imgScr = Convert(img); NewButon.LargeImage = imgScr; NewButon.Image = imgScr; return(Result.Succeeded); }