private static bool IsPluginSupported(IPlugin plugin, Version version) { bool result = plugin.SupportedManagerVersion.IsCompartibleWith(version); if (!result) { LogManager.Warning(String.Format(String.Format("Not compatible plugin. Aplication version: {0}, Plugin: ({1})", version, PluginTostring(plugin)))); } return result; }
public static List<IPlugin> GetValidPlugins(List<IPlugin> oldPlugins, Version version) { var newPlugins = oldPlugins .Where(plugin => IsPluginSupported(plugin, version)) //Find max version of plugin .GroupBy(plugin => plugin.Uid) .Select(FindMaxVersionPlugin) .ToList(); return newPlugins; }