public LocalPlugin LoadPlugin(string assemblyName, string typeName) { Start(); OpenPluginLoader(); var pluginRaw = _pluginLoader.LoadPlugin(assemblyName, typeName); var plugin = new LocalPlugin(pluginRaw) { Title = GetTitle(typeName) }; Plugins.Add(plugin); ++_refCount; plugin.Disposed += OnPluginDisposed; return plugin; }
private void Load() { try { var pluginHost = new PluginHostProxy { Is64Bit = (Bitness == 64), JobObject = new JobManagement.Job() }; var plugin = pluginHost.LoadPlugin(AssemblyName, ClassName); plugin.Disposed += plugin_Disposed; plugin.MessageFromPlugin += plugin_MessageFromPlugin; Plugins.Add(plugin); SelectedPlugin = plugin; } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
public void CloseTab(LocalPlugin plugin) { Plugins.Remove(plugin); plugin.Dispose(); }