internal PluginsManager(Func <PluginManifest, Assembly, object> pluginActivator, PluginsProvider pluginProvider) { _pluginActivator = pluginActivator ?? DefaultPluginActivator(typeof(IEasyPlugin)); _pluginsProvider = pluginProvider ?? new FsPluginsProvider(); _pluginManifests = new List <PluginManifest>(); _pluginAssemblies = new List <Assembly>(); _pluginReferencedAssemblies = new List <Assembly>(); }
/// <summary> /// Initialize the plugin manager to setup with EasyPlugins system. /// </summary> /// <param name="pluginType"></param> /// <param name="pluginProvider"></param> /// <returns></returns> public static PluginsManager Initialize(Type pluginType, PluginsProvider pluginProvider = null) { return(Initialize(pluginType == null ? null: DefaultPluginActivator(pluginType), pluginProvider)); }
/// <summary> /// Initialize the plugin manager to setup with EasyPlugins system. /// </summary> /// <param name="pluginActivator"></param> /// <param name="pluginProvider"></param> /// <returns></returns> public static PluginsManager Initialize(Func <PluginManifest, Assembly, object> pluginActivator, PluginsProvider pluginProvider = null) { if (_instance != null) { throw new PluginsException(ErrorCode.PluginManagerAlreadyInitialized); } var watch = new Stopwatch(); watch.Start(); _instance = new PluginsManager(pluginActivator, pluginProvider).Init(); watch.Stop(); _instance.InitializationDuration = watch.ElapsedMilliseconds; return(_instance); }
/// <summary> /// Initialize the plugin manager to setup with EasyPlugins system. /// </summary> /// <param name="pluginProvider"></param> /// <returns></returns> public static PluginsManager Initialize(PluginsProvider pluginProvider = null) { return(Initialize((Type)null, pluginProvider)); }