Exemplo n.º 1
0
        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>();
        }
Exemplo n.º 2
0
 /// <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));
 }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
 /// <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));
 }