コード例 #1
0
        public static void GetPluginAssemblies([NotNull] this PluginHost pluginHost, [NotNull] IList <string> fileNames, bool includePackages, bool includeAssemblies, bool includeServerComponents)
        {
            Assert.ArgumentNotNull(pluginHost, nameof(pluginHost));
            Assert.ArgumentNotNull(fileNames, nameof(fileNames));

            AppHost.Files.CreateDirectory(AppHost.Plugins.PluginFolder);
            AppHost.Files.CreateDirectory(AppHost.Plugins.PackageFolder);

            pluginHost.CleanPluginFolder();
            pluginHost.CleanPackageFolder();

            if (includeAssemblies)
            {
                pluginHost.GetPluginAssembliesFromPluginFolder(fileNames);
                pluginHost.GetPluginAssembliesFromPluginFolders(fileNames);
                pluginHost.GetPluginAssembliesFromCommandLine(fileNames, includeServerComponents);

                RemoveUninstalledAssemblies(fileNames);
            }

            if (includePackages)
            {
                pluginHost.GetPluginAssembliesFromPackages(fileNames);
            }
        }