C# Class Revit.SDK.Samples.AutoStamp.CS.EventsReactor

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.
Mostrar archivo Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
AppViewPrinted ( object sender, Autodesk e ) : void

Handler method for ViewPrinted event. This handler will dump information of printed view firstly and then delete the TextNote created in pre-event handler.

AppViewPrinting ( object sender, Autodesk e ) : void

Handler method for ViewPrinting event. This method will dump EventArgument information of event firstly and then create TextNote element for this view. View print will be cancelled if TextNote creation failed.

CloseLogFiles ( ) : void

Close log files now

EventsReactor ( ) : System

Constructor method, it will only initialize m_assemblyPath. Notice that this method won't open log files at this time.

Private Methods

Method Description
DumpEventArguments ( RevitAPIEventArgs eventArgs ) : void

Dump the events arguments to log file PrintEventsLog.txt. This method will only dump EventArguments of ViewPrint, two event arguments will be handled: ViewPrintingEventArgs and ViewPrintedEventArgs. Typical properties of EventArgs of them will be dumped to log file.

DumpViewInfo ( View view, String prefix ) : void

Dump information of view(View name and type) to log file.

SetupLogFiles ( ) : void

For singleton consideration, setup log file only when ViewPrinting is raised. m_eventsLog will be initialized and added to Trace.Listeners, PrintEventsLog.txt will be removed if it already existed.

Method Details

AppViewPrinted() public method

Handler method for ViewPrinted event. This handler will dump information of printed view firstly and then delete the TextNote created in pre-event handler.
public AppViewPrinted ( object sender, Autodesk e ) : void
sender object Event sender.
e Autodesk Event arguments of ViewPrinted event.
return void

AppViewPrinting() public method

Handler method for ViewPrinting event. This method will dump EventArgument information of event firstly and then create TextNote element for this view. View print will be cancelled if TextNote creation failed.
public AppViewPrinting ( object sender, Autodesk e ) : void
sender object Event sender.
e Autodesk Event arguments of ViewPrinting event.
return void

CloseLogFiles() public method

Close log files now
public CloseLogFiles ( ) : void
return void

EventsReactor() public method

Constructor method, it will only initialize m_assemblyPath. Notice that this method won't open log files at this time.
public EventsReactor ( ) : System
return System