This class has four handler methods which will be subscribed to ViewPrint and DocumentPrint events separately, It contains other methods which are used to dump related information to log files. The handler methods will be used to dump designed information to log files when they are raised by Print operations(both UI and API). This class contains two log file handlers m_printLog and m_eventsLog, they will dump information to PrintLog.txt and PrintEventsLog.txt separately. PrintEventsLog.txt only contains the information of events, like events arguments and sequences. The PrintLog.txt contains all information of print, date time stamp and cost time of print are dumped especially.
Beispiel #1
0
 /// <summary>
 /// Implement 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);
     application.ControlledApplication.DocumentPrinting += new EventHandler<Autodesk.Revit.DB.Events.DocumentPrintingEventArgs>(m_eventsReactor.AppDocumentPrinting);
     application.ControlledApplication.DocumentPrinted += new EventHandler<Autodesk.Revit.DB.Events.DocumentPrintedEventArgs>(m_eventsReactor.AppDocumentPrinted);
     return Autodesk.Revit.UI.Result.Succeeded;
 }
 /// <summary>
 /// Implement 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);
     application.ControlledApplication.DocumentPrinting += new EventHandler<Autodesk.Revit.DB.Events.DocumentPrintingEventArgs>(m_eventsReactor.AppDocumentPrinting);
     application.ControlledApplication.DocumentPrinted += new EventHandler<Autodesk.Revit.DB.Events.DocumentPrintedEventArgs>(m_eventsReactor.AppDocumentPrinted);
     return Autodesk.Revit.UI.Result.Succeeded;
 }