コード例 #1
0
        /// <summary>
        /// Create a plugin loader using the settings from a plugin config file.
        /// <seealso cref="PluginConfig" /> for defaults on the plugin configuration.
        /// </summary>
        /// <param name="filePath">The file path to the plugin config.</param>
        /// <param name="sharedTypes">A list of types which should be shared between the host and the plugin.</param>
        /// <returns>A loader.</returns>
        public static PluginLoader CreateFromConfigFile(string filePath, Type[] sharedTypes = null)
        {
            var config  = PluginConfig.CreateFromFile(filePath);
            var baseDir = Path.GetDirectoryName(filePath);

            return(new PluginLoader(config, baseDir, sharedTypes, PluginLoaderOptions.None, null));
        }