예제 #1
0
 /// <summary>
 /// Loads log plugins from the script, so errors are logged.
 /// </summary>
 /// <param name="script">
 /// The script to load the imports from.
 /// </param>
 /// <param name="loggers">
 /// The loggers collection to add the loggers to.
 /// </param>
 /// <param name="pluginResolver">
 /// The plugin resolver to use.
 /// </param>
 public static void LoadLogPlugins(Block script, LoggerCollection loggers, [CanBeNull] IPluginResolver pluginResolver)
 {
     if (pluginResolver != null)
     {
         new PluginLoader(pluginResolver.EnumerateAvailablePlugins().ToArray(), loggers).Visit(script);
     }
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FileConfigStore"/> class.
 /// </summary>
 /// <param name="configFileName">
 /// The config file name.
 /// </param>
 /// <param name="pluginResolver">
 /// The plugin resolver.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 public FileConfigStore(string configFileName, IPluginResolver pluginResolver, ILogger logger)
     : this()
 {
     this.ConfigFile = configFileName;
     this._pluginResolver = pluginResolver;
     this.Logger = logger;
 }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginCollection"/> class.
        /// </summary>
        /// <param name="resolver">
        /// The resolver.
        /// </param>
        public PluginCollection([CanBeNull] IPluginResolver resolver)
        {
            if (resolver is IDynamicPluginResolver dynamicResolver)
            {
                dynamicResolver.AvailablePluginsChanged += (o, e) =>
                {
                    this.IsLoading = dynamicResolver.IsLoading;
                    this.plugins   = dynamicResolver.EnumerateAvailablePlugins().ToArray();

                    this.AvailablePluginsChanged?.Invoke(this, e);
                };

                this.IsLoading = dynamicResolver.IsLoading;
            }

            this.plugins = resolver?.EnumerateAvailablePlugins().ToArray() ?? new IConnectQlPlugin[0];
        }
예제 #4
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ConnectQlContext" /> class.
 /// </summary>
 /// <param name="resolver">
 ///     The resolver.
 /// </param>
 public ConnectQlContext(IPluginResolver resolver)
 {
     this.PluginResolver = resolver;
 }
예제 #5
0
 public PluginFactoryImpl(IProjectRepository projectRepository, IPluginResolver pluginResolver)
 {
     ProjectRepository = projectRepository;
     PluginResolver    = pluginResolver;
 }