The problem is you have a number of PlugIns in your application, however how do you know which plugins have implemented an interface for a task you need to perform?
Following on from my last article, Plugin Model, I will create a new interface, implement that interface and then find the Plugin that implments that interface.
First lets create a simple Interface
Next implement the interface to a plugin controller class
You can see it here as HelloWorld()
Okay now we need to find which plugins inplement that interface
As you can see above we go over the collection of plugins and check to see if the plugs has a TypeOf IInterface1, if it does then the plugin supports that interface.
So we can now convert the plugin in to the Interface type and use its interfaces.
I then took this a little further and implemented a Generic method that gets a list of support objects that support a given interface