Пример #1
0
        static void Main(string[] args)
        {
            PluginsManager pManager = PluginsManager.Instance;

            Console.WriteLine($"Current plugins count: {pManager.PluginCount}");
            Console.WriteLine($"HasType DataLoader? Answer: {pManager.HasType(PluginType.DataLoader)}");
            Console.WriteLine($"HasPlugin DataLoader? Answer: {pManager.HasType(PluginType.DataLoader)}");
            var config = new CsvFileConfiguration(@"C:\temp\config.txt");

            Console.WriteLine($"Loading plugin TestPlugin's configuration, result is: {pManager.LoadPluginConfiguration(PluginType.DataLoader, "TestPlugin",config)}");
            Console.WriteLine($"Running plugin TestPlugin, result is: {pManager.ExecutePlugin(PluginType.DataLoader, "TestPlugin")}");
            Console.WriteLine($"Printing current available plugins");
            foreach (var plugin in pManager.GetPlugins())
            {
                Console.WriteLine($"Name: {plugin.Name}, Description: {plugin.Description}, Version: {plugin.Version}, Type: {plugin.Type}");
            }
            Console.ReadKey();
        }