Beispiel #1
0
        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;
                }
            }
        }