public Result OnShutdown(UIControlledApplication app) { LODupdater lODupdater = new LODupdater(app.get_ActiveAddInId()); UpdaterRegistry.UnregisterUpdater(lODupdater.GetUpdaterId()); app.get_ControlledApplication().remove_DocumentOpened((EventHandler <DocumentOpenedEventArgs>)lodApp_DocumentOpened); app.get_ControlledApplication().remove_DocumentClosing((EventHandler <DocumentClosingEventArgs>)lodApp_DocumentClosing); return(0); }
public Result OnStartup(UIControlledApplication app) { app.CreateRibbonTab("LOD Manager"); RibbonPanel panel = app.CreateRibbonPanel("LOD Manager", "LOD Parameters"); AddRibbonItems(panel); LODupdater lODupdater = new LODupdater(app.get_ActiveAddInId()); UpdaterRegistry.RegisterUpdater(lODupdater, true); ElementFilter val = new ElementCategoryFilter(-2005000, true); UpdaterRegistry.AddTrigger(lODupdater.GetUpdaterId(), val, Element.GetChangeTypeElementAddition()); app.get_ControlledApplication().add_DocumentOpened((EventHandler <DocumentOpenedEventArgs>)lodApp_DocumentOpened); app.get_ControlledApplication().add_DocumentClosing((EventHandler <DocumentClosingEventArgs>)lodApp_DocumentClosing); return(0); }