How to create a very basic plugin system

so first we plan the design. I have a combobox with a button, and I have a plugins folder.

says that I have the imageeffect.cs plugin in the plugins folder. this class MUST have properties such as "title". My program gets this β€œheader” and dynamically loads the combobox with this header. So now my program recognizes the plugin. Now, when the user clicks the button, I want some data (processed by my program) to be transferred to the imageeffect.cs plugin, where he does everything that works on him and returns me the status.

so repeat. my program reads the plugin directory. loads each plugin "title" property (defined by my plugin creator) into combobox. When the user clicks the "data" button or in this case the image is sent to the plugin, and the plugin really works on it. he then returns me the β€œStatus” or in this case the image back with any effects that he wanted.

+4
source share
3 answers
+8
source

I wrote a blog post a while ago 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

+4
source

Ok FIrst I would suggest that your plugins are compiled .dlls, not just .cs files. However, if you want to use only .cs files, first look here:

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

And then to implement the plugin, look at this article:

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

Hope that helps :)

0
source

All Articles