コード例 #1
0
 public static IEnumerable <Exports.IAssembly> Assemblies(this IPackageExporter exporter, IPackage package, ExecutionEnvironment environment)
 {
     return(exporter.Exports <Exports.IAssembly>(package, environment).SelectMany(x => x));
 }
コード例 #2
0
        private HostedAppInfo getAppLoadParams(IHostedApplicationExport appExport)
        {
            string path = Path.GetFullPath(Path.Combine("apps", appExport.Name));

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            IEnumerable <IPackageInfo> packages = new[] { appExport.Package }.Concat(
                ServiceLocator.GetService <IPackageResolver>().TryResolveDependencies(appExport.Package.Descriptor, new[] { m_ProjectRepository }).SuccessfulPackages.Select(_ => _.Packages.First())
                );
            IEnumerable <Exports.IAssembly> assembliesTooLoad = packages.SelectMany(p => m_Exporter.Exports <Exports.IAssembly>(p.Load(), m_Environment))
                                                                .SelectMany(e => e.Select(f => f));
            IEnumerable <string> nativeDllsToLoad             = packages.SelectMany(p => m_Exporter.Exports <INativeDll>(p.Load(), m_Environment)).SelectMany(e => e.Select(f => f.File.Path.FullPath));

            return(new HostedAppInfo(appExport.Name, appExport.Version, appExport.Type, path,
                                     assembliesTooLoad.ToDictionary(a => a.AssemblyName, a => a.File.Path.FullPath), nativeDllsToLoad));
        }