Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create very basic plugin system

Tags:

c#

plugins

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.

like image 733
masfenix Avatar asked Jan 15 '10 18:01

masfenix


People also ask

How do I create a Web plug-in?

To create a plugin, all you need to do is create a folder and then create a single file with one line of content. Navigate to the wp-content/plugins folder, and create a new folder named awesomeplugin . Inside this new folder, create a file named awesomeplugin. php.

What is a plug-in system?

plug-in, also called add-on or extension, computer software that adds new functions to a host program without altering the host program itself. Widely used in digital audio, video, and Web browsing, plug-ins enable programmers to update a host program while keeping the user within the program's environment.

What are plugins example?

Examples include the Adobe Flash Player, a Java virtual machine (for Java applets), QuickTime, Microsoft Silverlight and the Unity Web Player. (Browser extensions, which are a separate type of installable module, are still widely in use.)


1 Answers

MEF with a DirectoryCatalog.

like image 76
dtb Avatar answered Oct 03 '22 23:10

dtb