I need to keep track of events such as Database.ObjectAppended, Database.ObjectModified at a per-document level for all documents opened, created and existing in AutoCAD.
What is the best way to achieve this through the .Net API?
The attached VB.Net sample illustrates how to achieve this:
The idea is to create a custom class, called PerDocController in my example, that will be responsible for holding the events at a per-document level.
The command class is then holding a dictionary of <Document, PerDocController> pairs for each loaded document.
The events DocumentActivated and DocumentToBeDestroyed are then used to keep this dictionary up-to-date.
The complete code is provided in the attached project.