CoolStorage allows you to attach an event to almost any operation performed on the CoolStorage objects. You can attach events to specific instances of objects, or on any CoolStorage-derived class.
The following events can be intercepted:
To attach an event handler to a single object, you attach the event handler to the object's "ObjectXXXXX" event, where XXXXX is the name of the event, as listed above.
To attach an event handler to any instance of an object of a specific type, you attach the event handler to the event handler "AnyObjectXXXXX", declared at the class level as a static event.
For example:
Customer customer = Customer.New(); // attach an event to a single object. The event will be fired after // the object was created and stored in the database customer.ObjectCreated += MyCustomerCreatedEventHandler; // attach an event to the Order class. The event will be fired after // ANY object of class Order is deleted from the database Order.AnyObjectDeleted += MyDeletedOrderEventHandler;