internal static void Initialize(bool isStartup, List<string> pluginsToIgnore = null) { if (isStartup) { CopyIntalledPluginsToRunnableLocation(); UninstallPlugins(); } if (mGlobalInstance == null) { mGlobalInstance = new PluginManager(true); mGlobalInstance.LoadPlugins(@"FRBDK\Plugins", pluginsToIgnore); foreach (var output in mGlobalInstance.CompileOutput) { ReceiveOutput(output); } foreach (var output in mGlobalInstance.CompileErrors) { ReceiveError(output); } } if (mProjectInstance != null) { foreach (IPlugin plugin in ((PluginManager)mProjectInstance).mPluginContainers.Keys) { ShutDownPlugin(plugin, PluginShutDownReason.GlueShutDown); } } mProjectInstance = new PluginManager(false); mInstances.Clear(); mInstances.Add(mGlobalInstance); mInstances.Add(mProjectInstance); mProjectInstance.LoadPlugins(@"FRBDK\Plugins"); foreach (var error in mProjectInstance.CompileErrors) { GlueGui.ShowException(error, "Plugin Error", new Exception(error)); } }
private static void PrintError(string output, PluginManager pluginManager) { foreach (IOutputReceiver plugin in pluginManager.OutputReceiverPlugins) { PluginContainer container = pluginManager.mPluginContainers[plugin]; if (container.IsEnabled) { IOutputReceiver plugin1 = plugin; PluginCommand(() => { plugin1.OnErrorOutput(output); },container, "Failed in ReactToChangedFile"); } } // Execute the new style plugins var plugins = pluginManager.ImportedPlugins.Where(x => x.OnErrorOutputHandler != null); foreach (var plugin in plugins) { var container = pluginManager.mPluginContainers[plugin]; if (container.IsEnabled) { PluginBase plugin1 = plugin; PluginCommand(() => { plugin1.OnErrorOutputHandler(output); },container, "Failed in OnErrorOutput"); } } }