Introduction to Revit 2011 API
Events
Event
Handler, Registering and Unregistering events
§EventHandler
§
§
§
§Registering events
§
§
§
§Unregistering events
§
§
§
public Result
OnStartup(UIControlledApplication application)
{
application.ControlledApplication.DocumentChanged
+= UILabs_DocumentChanged;
return Result.Succeeded;
}
public Result
OnShutdown(UIControlledApplication application)
{
application.ControlledApplication.DocumentChanged -=
UILabs_DocumentChanged;
return Result.Succeeded;
}
public void
UILabs_DocumentChanged(object sender, DocumentChangedEventArgs
args)
{
// Do something here
}