public ProjectPluginController( PluginSupervisor supervisor, IProjectPluginProviderPlugin plugin) { Supervisor = supervisor; Plugin = plugin; ProjectPlugin = plugin.GetProjectPlugin(supervisor.Project); }
/// <summary> /// Tries to get the given project plugin via the name. /// </summary> /// <param name="pluginName">Name of the plugin.</param> /// <param name="plugin">The plugin, if found.</param> /// <returns><c>true<c> if the plugin is found, otherwise </c>false</c>.</returns> public bool TryGetProjectPlugin( string pluginName, out IProjectPluginProviderPlugin plugin) { // Go through all the project plugins and make sure they are both a // project plugin and they match the name. foreach (IPlugin projectPlugin in Plugins) { if (projectPlugin.Key == pluginName && projectPlugin is IProjectPluginProviderPlugin) { plugin = (IProjectPluginProviderPlugin)projectPlugin; return(true); } } // We couldn't find it, so put in the default and return a false. plugin = null; return(false); }
/// <summary> /// Tries to get the given project plugin via the name. /// </summary> /// <param name="pluginName">Name of the plugin.</param> /// <param name="plugin">The plugin, if found.</param> /// <returns><c>true<c> if the plugin is found, otherwise </c>false</c>.</returns> public bool TryGetProjectPlugin( string pluginName, out IProjectPluginProviderPlugin plugin) { // Go through all the project plugins and make sure they are both a // project plugin and they match the name. foreach (IPlugin projectPlugin in Plugins) { if (projectPlugin.Key == pluginName && projectPlugin is IProjectPluginProviderPlugin) { plugin = (IProjectPluginProviderPlugin) projectPlugin; return true; } } // We couldn't find it, so put in the default and return a false. plugin = null; return false; }