/// <summary> /// Implements the OnStartup method to register events when Revit starts. /// </summary> /// <param name="application">Controlled application of to be loaded to Revit process.</param> /// <returns>Return the status of the external application.</returns> public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application) { // Register related events m_eventsReactor = new EventsReactor(); application.ControlledApplication.ViewPrinting += new EventHandler<Autodesk.Revit.DB.Events.ViewPrintingEventArgs>(m_eventsReactor.AppViewPrinting); application.ControlledApplication.ViewPrinted += new EventHandler<Autodesk.Revit.DB.Events.ViewPrintedEventArgs>(m_eventsReactor.AppViewPrinted); return Autodesk.Revit.UI.Result.Succeeded; }
/// <summary> /// Implements the OnStartup method to register events when Revit starts. /// </summary> /// <param name="application">Controlled application of to be loaded to Revit process.</param> /// <returns>Return the status of the external application.</returns> public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application) { // Register related events m_eventsReactor = new EventsReactor(); application.ControlledApplication.ViewPrinting += new EventHandler <Autodesk.Revit.DB.Events.ViewPrintingEventArgs>(m_eventsReactor.AppViewPrinting); application.ControlledApplication.ViewPrinted += new EventHandler <Autodesk.Revit.DB.Events.ViewPrintedEventArgs>(m_eventsReactor.AppViewPrinted); return(Autodesk.Revit.UI.Result.Succeeded); }