This class consists of two handler methods which will be subscribed to ViewPrinting and ViewPrinted events separately, The pre-event handler will create TextNote element when event is raised, and the post-event handler will delete it. Meanwhile, these two handler methods will be used to dump designed information to log file. It contains other methods which are used to dump related information(like events arguments and sequences) to log file PrintEventsLog.txt.
Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
 /// <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);
 }