Call Host method from IPlugin
I'm currently building a plugin system using IPluginInterface. The plugins include the whole logic, the host just enables/disables the plugins and configures them.
However, there are certain Host methods I sh开发者_运维技巧ould be able to call from a plugin. I've tested various ideas, but none of them seems to work fine.
How can I achieve this?
Have the host implementing IHost
( somethin like this ), have the plugin exposing a function ( ie Initizialize(IHost host)
) and pass the host to the plugin.
精彩评论