API/Plugin System


Create an API and the ability to load user plugins and expose events.
e.g. I may want to perform a certain action when creating a new post thus I'd create a plugin and hook on to the NewPostCreated(Post ThePost) event and when a new post is created it will loop through all loaded plugins and call the Run() method.


Pidgey wrote May 18, 2011 at 9:38 PM

SimplePlugin for SimpleForum attached in a zip - not finished. Just uploading here so it can be viewed and commented on.

eth0 wrote Dec 7, 2011 at 11:20 AM

I'd like to use MEF for the plugins, we can also use Ninject to pass dependencies around easily to plugins when requested.

eth0 wrote Dec 9, 2011 at 10:53 PM

This is implemented with MEF and fully working. Plugins have prerequisites: must reference SimpleForum.Contracts, System.ComponentModel.Composition, System.Web and System.Web.Mvc. A plugin must include a "PluginInfo.cs" in its root directory that implements IPluginInfo decorated with the attribute: [Export(typeof(IPluginInfo))]. All views should be placed in ~/Views folder and contain a _ViewStart.cshtml and Web.Config

I don't like the idea of plugins having both _ViewStart and Web.Config so we need to find way to remove this requirement...

wrote Dec 9, 2011 at 10:54 PM

eth0 wrote Dec 10, 2011 at 12:15 AM

Further more, if you need data access in your plugin just reference SimpleForum.Data and pass in the service interfaces as parameters in your constructor, Unity will inject them automatically for you.

wrote Feb 13, 2013 at 1:45 AM