tags:

views:

149

answers:

3

Hi, so lets layout the design first. I have a combobox with a button, and i have a plugins folder.

lets say i have a plugin imageeffect.cs in the plugins folder. this class MUST have properties such as "title". My program gets this "title" and dynamically load the combobox with this title. So now my program recognizes the plugin. Now when the user clicks the button, I want some data (processed by my program) be passed off to the imageeffect.cs plugin where it does whatever work on it and returns me a status.

so recap. my program reads a plugin directory. loads up each plugin's "title" property (defined my whoever is creating the plugin) to the combobox. When the user clicks the button, the "data" or in this case the image is sent to the plugin and the plugin does work on it. it then returns me the "Status" or in this case a picture back with whatever effects it wanted.

+6  A: 

MEF with a DirectoryCatalog.

dtb
MEF is for .NET 4.0, or is it compatible with 2.0/3.0/3.5?
STW
MEF will be included in the .NET 4.0 Framework, but you can also download it from the MEF website for use with previous versions.
dtb
A: 

Ok. FIrst I would suggest that your plugins are compiled .dlls rather than just .cs files. However, if you would like to use just .cs files, first take a look here:

http://www.codeproject.com/KB/cs/livecodedotnet.aspx

And then for implementing the plugin system, look at this article:

http://www.codeproject.com/KB/cs/c__plugin_architecture.aspx

Hope that helps :)

TJMonk15
+3  A: 

I wrote a blog post a while back to illustrate a very simple plugin system. This may be good enough for your needs:

http://crazorsharp.blogspot.com/2009/03/net-reflection-part-2-loading.html

BFree