开发者

Call Host method from IPlugin

开发者 https://www.devze.com 2023-03-19 00:10 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消