All Cartella instalations have a file in the App_Code directory called "EventHooks.cs". This file is where you can add cutom code to tap into a variety of Cartella Events.

Enableing Global Manager Events

First locate the "EventHooks.cs" file. You'll notice that the file is commented. If cartella cannot find that class, it will not wire up any of the Global Manager Events. To enable tghe events, simply uncomment the file. Notice that EventHooks implements the ICartellaEventHooks interface. Becuase of this, if you wish to add you own custom logic to these events, you must implement all the events.

For your convenience, all the EventArgs for the events have had 3 properties added to them.

  • UserID - A string representing the ID of the user that initiated the event.

  • FailSilently - A Boolean Property that tells Cartella to ignore any Exception that may be thrown inside of your event handler. Set this to true if you are performing non-creitical operations. By default this is set to false.

  • Logger - A CartellaLogger object that derives from NLog. You can use this object to write to the Cartella Log that can be found in the App_data directory.