EPiWiki.se  - EPiServer notes shared with others
 

Plugins

[Edit]
Code snippets for creating plug-ins for EPiServer.

Scheduled plugin


A scheduled plug-in base class.

[ScheduledPlugIn(
  DisplayName = "My scheduled Plugin",
  Description = "Description of plugin.")]
public class MyScheduledPlugin : JobBase
{
   private static readonly object JobLock = new object();
 
   public string Execute()
   {
      if (!Monitor.TryEnter(JobLock))
      {
         throw new ApplicationException("An other import job is executing!");
      }
 
      try
      {
         //DO stuff...
      }
      finally
      {
         Monitor.Exit(JobLock);
      }
   }
 }

Version author:
Mattias Lövström

EPiServer version

All