public static Result OnStartup(UIControlledApplication app) { MFElePlaced.StartUp(app.ActiveAddInId); app.ControlledApplication.DocumentOpened += new EventHandler <DocumentOpenedEventArgs>(OpenedEvent); app.ControlledApplication.DocumentClosing += new EventHandler <DocumentClosingEventArgs>(ClosingEvent); app.ControlledApplication.DocumentCreated += new EventHandler <DocumentCreatedEventArgs>(CreatedEvent); RegisterUpdater(app.ActiveAddInId); return(Result.Succeeded); }
public static void StartUp(AddInId id) { MFElePlaced updater = new MFElePlaced(id); UpdaterRegistry.RegisterUpdater(updater, true); UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), new ElementClassFilter(typeof(FamilyInstance)), Element.GetChangeTypeElementAddition()); }
public static Result OnShutdown(UIControlledApplication app) { MFElePlaced.ShutDown(app.ActiveAddInId); app.ControlledApplication.DocumentOpened -= new EventHandler <DocumentOpenedEventArgs>(OpenedEvent); app.ControlledApplication.DocumentClosing -= new EventHandler <DocumentClosingEventArgs>(ClosingEvent); app.ControlledApplication.DocumentCreated -= new EventHandler <DocumentCreatedEventArgs>(CreatedEvent); MFTypeNameChange updater = new MFTypeNameChange(app.ActiveAddInId); UpdaterRegistry.UnregisterUpdater(updater.GetUpdaterId()); return(Result.Succeeded); }
public static void ShutDown(AddInId id) { MFElePlaced updater = new MFElePlaced(id); UpdaterRegistry.UnregisterUpdater(updater.GetUpdaterId()); }