// can be executed on any thread public void Load(PluginCatalogEntry catalogEntry) { if (CatalogEntry != null) { throw new InvalidOperationException("Plugin can be loaded only once"); } CatalogEntry = catalogEntry; Title = catalogEntry.Name; Initialize(); _log.Debug(String.Format("Loading plugin {0} from {1}, {2}", CatalogEntry.Name, CatalogEntry.AssemblyPath, CatalogEntry.MainClass)); var host = _childContainer.Resolve <PluginViewOfHost>(); host.FatalError += OnFatalError; _remoteProcess = _childContainer.Resolve <PluginProcessProxy>(); _log.Debug("Starting plugin process"); _remoteProcess.Start(); new ProcessMonitor(OnProcessExited).Start(_remoteProcess.Process); _log.Debug("Calling LoadPlugin()"); _remoteProcess.LoadPlugin(); }
// can be executed on any thread public void Load(PluginCatalogEntry catalogEntry) { if (CatalogEntry != null) throw new InvalidOperationException("Plugin can be loaded only once"); CatalogEntry = catalogEntry; Title = catalogEntry.Name; Initialize(); _log.Debug(String.Format("Loading plugin {0} from {1}, {2}", CatalogEntry.Name, CatalogEntry.AssemblyPath, CatalogEntry.MainClass)); var host = _childContainer.Resolve<PluginViewOfHost>(); host.FatalError += OnFatalError; _remoteProcess = _childContainer.Resolve<PluginProcessProxy>(); _log.Debug("Starting plugin process"); _remoteProcess.Start(); new ProcessMonitor(OnProcessExited).Start(_remoteProcess.Process); _log.Debug("Calling LoadPlugin()"); _remoteProcess.LoadPlugin(); }