c# - 在关闭时将触发器/事件从插件传递到主应用程序
问题描述
所以我有一个运行简单“插件选择”的程序。为了方便使用,当插件加载时,我将原始申请表设为不可见。
问题是当插件关闭时,我想不出一种方法将触发器传递回原始应用程序以检查插件是否关闭,然后使主应用程序再次可见(或者为简单起见,只需关闭) .
我的第一次尝试并不顺利:
// Looks for the instance of the plugin, and loads the instance, and opens the Form in that instance
if (LoadPlugin(plugin))
{
// While the instanced plugin Form is visible
while (Global.Plugins.AvailablePlugins.Find(plugin).Instance.PluginForm.Visible)
{
// Makes this form invisible, to maintain the parent Application instance to host the Plugin
this.Visible = false;
}
// When the plugin form closes, close this form, and end the program.
this.Close();
}
解决方案
推荐阅读
- java - 如何将 InputMethodService 与服务连接?
- android - 如何通过有线连接从 PC 接收串行数据?
- c# - 在 IdentityServer4 登录中重定向到 Angular 应用程序时出现 405 Method not Allowed/CORS origin 问题
- python-3.x - ImportError:扩展 horovod.tensorflow 尚未构建
- string - 如何在oracle sql查询where子句中从另一个表中查找冒号分隔的值
- docker - 如何使用 docker 容器名称而不是 IP 与 knex 进行数据库连接
- advanced-custom-fields - 木材中的 ACF 帖子对象未显示在页面模板上
- postgresql - psql 提示更改为“-#”并且该语句未提交
- twitter-bootstrap - odoo登录时默认打开Toggle App Drawer
- java - 获取带有属性的 RabbitMQ 主体