Skip to content

Instantly share code, notes, and snippets.

@davidknipe
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidknipe/8d03964c6578febe2608 to your computer and use it in GitHub Desktop.
Save davidknipe/8d03964c6578febe2608 to your computer and use it in GitHub Desktop.
Example PriceEvent listener for the PriceEvents for EPiServer Commerce
[InitializableModule]
[ModuleDependency( typeof(EPiServer.Web. InitializationModule))]
public class PriceEventListenerInit : IInitializableModule
{
public void Initialize( InitializationEngine context)
{
var priceEvents = ServiceLocator.Current.GetInstance<IPriceEvents>();
priceEvents.PriceChanged += contentEvents_PriceChanged;
}
void contentEvents_PriceChanged( object sender, PriceEvents.Events.PriceEventArgs e)
{
//TODO: Your implementation here
}
public void Uninitialize( InitializationEngine context)
{
var priceEvents = ServiceLocator.Current.GetInstance<IPriceEvents>();
priceEvents.PriceChanged -= contentEvents_PriceChanged;
}
public void Preload(string[] parameters) { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment