예제 #1
0
        public IEnumerable <IHtcPlugin> LoadPluginsCustom(string pluginsPath, string searchPattern)
        {
            if (!Directory.Exists(pluginsPath))
            {
                Logger.Fatal($"Plugins path '{pluginsPath}' does not exist!");
            }
            var pluginLoader = new PluginLoader <IHtcPlugin>();

            return(pluginLoader.LoadPlugins(IoUtils.GetFilesExceptionFix(pluginsPath, searchPattern, SearchOption.AllDirectories)));
        }
예제 #2
0
        public void LoadPlugins(string pluginsPath)
        {
            if (!Directory.Exists(pluginsPath))
            {
                Logger.Fatal($"Plugins path '{pluginsPath}' does not exist!");
                Environment.Exit(2);
            }
            var pluginLoader = new PluginLoader <IHtcPlugin>();

            foreach (var plugin in pluginLoader.LoadPlugins(IoUtils.GetFilesExceptionFix(pluginsPath, "*.plugin.dll", SearchOption.AllDirectories)))
            {
                _plugins.Add(plugin);
            }
        }