private void CmbSubSystem_SelectedIndexChanged(object sender, EventArgs e) { if (PlanSystem != null) { RefreshPluginPlanFormTreeView(); SavePlans?.Invoke(this, new EventArgs()); } PlanSystem = (IPluginPlanSystem)cmbSubSystem.SelectedItem; ReloadSystemInfo(PlanSystem.SysInfo); //加载软件信息 ReloadPluginPlans(PlanSystem.Plans); //加载插件方案列表 }
/// <summary> /// 实例化插件管理窗口,对指定程序进行插件管理 /// </summary> /// <param name="pluginPlanSystem">要管理的应用软件插件方案系统</param> /// <param name="pluginDir">需要管理插件的程序所在的目录</param> /// <param name="assemblyFilter">插件程序集文件过滤条件</param> public PluginManagerForm(IPluginPlanSystem pluginPlanSystem = null, string pluginDir = null, string assemblyFilter = null) { InitializeComponent(); InitSubFormEvents(); InitPluginLibrary(pluginDir, assemblyFilter); //加载dll和exe文件的命令仓库 pluginPlanSystem = pluginPlanSystem ?? CreatePluginPlanSystem(); pluginPlanSystem.SysInfo = pluginPlanSystem.SysInfo ?? CreateAssemblySystemInfo(); if (pluginPlanSystem.Plans.Count == 0) { pluginPlanSystem.Plans.Add(CreatePluginPlan(pluginPlanSystem.SysInfo.AppDir)); } cmbSubSystem.Items.Add(pluginPlanSystem); cmbSubSystem.SelectedIndex = 0; }