private static void LoadPluginDll() { var extensions = new List <string> { ".dll", ".DLL" }; var pathOfDll = Directory.GetFiles(pathForSeekDLL, "*.*", SearchOption.AllDirectories) .Where(fileName => extensions.IndexOf(Path.GetExtension(fileName)) >= 0 && fileName.EndsWith(selectedPluginDllName + ".dll", StringComparison.OrdinalIgnoreCase)) .FirstOrDefault(); _app.LoadPlugin(Assembly.LoadFrom(pathOfDll)); }
private static void PluginLoading() { var configuration = new Configuration.Configuration(); string[] plugins = configuration.GetValue("plugins").Split(';'); Console.WriteLine("Choose what plugin to use"); for (var i = 0; i < plugins.Length; i++) { Console.WriteLine($"{i + 1}. {plugins[i]}"); } var pluginIsChosen = false; while (!pluginIsChosen) { if (TryReadUserInput(0, plugins.Length, out int chosenPlugin)) { App.LoadPlugin(Assembly.LoadFrom(plugins[chosenPlugin - 1])); pluginIsChosen = true; } } }