C# Class Revit.SDK.Samples.EventsMonitor.CS.EventManager

This class is a manager for application events. In this class, user can subscribe and remove the events according to what he select. This class used the controlled Application as the sender. If you want to use Application or Document as the sender, the usage is same. "+=" is used to register event and "-=" is used to remove event.
Mostrar archivo Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
EventManager ( UIControlledApplication app ) : System

Constructor for application event manager.

Update ( List selection ) : void

A public method used to update the events subscription

app_eventsHandlerMethod ( Object obj, EventArgs args ) : void

Generic event handler can be subscribed to any events. It will dump events information(sender and EventArgs) to log window and log file

Private Methods

Method Description
EventManager ( ) : System

Prevent the compiler from generating a default constructor.

addEvents ( String eventName ) : void

Register event according to event name. The generic handler app_eventsHandlerMethod will be subscribed to this event.

subtractEvents ( String eventName ) : void

Remove registered event by its name.

Method Details

EventManager() public method

Constructor for application event manager.
public EventManager ( UIControlledApplication app ) : System
app UIControlledApplication
return System

Update() public method

A public method used to update the events subscription
public Update ( List selection ) : void
selection List
return void

app_eventsHandlerMethod() public method

Generic event handler can be subscribed to any events. It will dump events information(sender and EventArgs) to log window and log file
public app_eventsHandlerMethod ( Object obj, EventArgs args ) : void
obj Object
args System.EventArgs
return void