public void LoadPlugins(string pluginPath) { _pluginResolver.ClearPlugins(); List <string> plugins = Directory.GetDirectories(pluginPath) .Where(directory => File.Exists(Path.Combine(directory, Path.GetFileName(directory) + ".dll"))) .Select(directory => Path.Combine(directory, Path.GetFileName(directory) + ".dll")).ToList(); foreach (string plugin in plugins) { try { Assembly assembly = Assembly.LoadFile(plugin); LoadAppDashPlugins(assembly); } catch (Exception e) { Console.WriteLine(e); throw; } } Console.WriteLine($"Loaded {_pluginResolver.GetPluginInstances().Count()} plugin(s)."); }
public void InitializePlugins() { foreach (AppDashPlugin plugin in _pluginResolver.GetPluginInstances()) { InitializePluginTiles(plugin.Key); InitializePluginSettings(plugin.Key); InitializePluginPages(plugin.Key); } }
public async Task <IEnumerable <AppDashPlugin> > GetPluginInstances() { await PluginLock.WaitAsync(); var plugins = _pluginResolver.GetPluginInstances(); PluginLock.Release(); return(plugins); }
public IEnumerable <AppDashPlugin> GetPluginInstances() { return(_pluginResolver.GetPluginInstances()); }