Hi !
I have a design questions about this scenario:
Suppose you have a form with many sites to be filled, let's call each site a plugin.
Among other classes I've created a PluginManager
class that takes evidence of all plugins and provides some functionality and properties:
class PluginManager
{
...
BasePlugin CurrentPlugin {get;set;}
IEnumerable<BasePlugin> OpenedPlugins {}
bool SetPlugin() {..}
...
}
class BasePlugin {}
class MyPlugin : BasePlugin {}
Among other thins, it handles displaying the chosen plugin / site.
Until now I never needed to communicate between 2 or more plugins. Now I do and I wanted to ask you, how would you do that.
My opinion was to add en Event
to the BasePlugin
class and handle it in PluginsManager
class, in some way, that the Plugin raising the Event
would provide in the EventArgs
the types of all other Plugins that should be affected and a list of delegates
pointing at the methods that should be executed.
Do you have any idea? Thank you !