Services
Event Model
In general, Merchello follows Umbraco's service event model in that most services expose:
Name | Description |
---|---|
Creating | Occurs before create |
Created | Occurs after create |
Saving | Occurs before saving |
Saved | Occurs after saved |
Deleting | Occurs before deleting |
Deleted | Occurs after delete |
/// <summary>
/// The umbraco event handler.
/// </summary>
public class UmbracoEventHandler : ApplicationEventHandler
{
/// <summary>
/// Handles Umbraco Events.
/// </summary>
/// <param name="umbracoApplication">
/// The <see cref="UmbracoApplicationBase"/>.
/// </param>
/// <param name="applicationContext">
/// Umbraco <see cref="ApplicationContext"/>.
/// </param>
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
StoreSettingService.Saved += StoreSettingServiceOnSaved;
}
/// <summary>
/// Clears the Bazaar currency if Merchello store settings are saved.
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The save event args.
/// </param>
private static void StoreSettingServiceOnSaved(IStoreSettingService sender, SaveEventArgs<IStoreSetting> e)
{
// do something when a setting is saved
}
}
Updated less than a minute ago