private static void LoadOneProvider( ICatalogLog log, string codebase, AggregateCatalog catalog ) { AssemblyCatalog assemblyCatalog = null; const string FailedToLoadAssemblyMessage = "Failed to load interpreter provider assembly {0} {1}"; try { assemblyCatalog = new AssemblyCatalog(codebase); } catch (Exception ex) { log.Log(String.Format(FailedToLoadAssemblyMessage, codebase, ex)); } if (assemblyCatalog == null) { return; } const string FailedToLoadMessage = "Failed to load interpreter provider {0} {1}"; try { catalog.Catalogs.Add(assemblyCatalog); } catch (Exception ex) { log.Log(String.Format(FailedToLoadMessage, codebase, ex)); } }
private static CompositionContainer CreateCatelog(ICatalogLog log, IEnumerable <string> asms) { var catalog = new AggregateCatalog(); foreach (var codeBase in asms) { LoadOneProvider( log, codeBase, catalog ); } return(new CompositionContainer(catalog)); }
public static CompositionContainer CreateContainer(ICatalogLog log, params string[] paths) { return(CreateCatelog(log, paths)); }
public static CompositionContainer CreateContainer(ICatalogLog log, params Type[] additionalTypes) { return(CreateContainer(log, GetProviderPaths(additionalTypes).ToArray())); }
public static CompositionContainer CreateContainer(ICatalogLog log, params string[] paths) { return CreateCatelog(log, paths); }
public static CompositionContainer CreateContainer(ICatalogLog log, params Type[] additionalTypes) { return CreateContainer(log, GetProviderPaths(additionalTypes).ToArray()); }
private static CompositionContainer CreateCatelog(ICatalogLog log, IEnumerable<string> asms) { var catalog = new AggregateCatalog(); foreach (var codeBase in asms) { LoadOneProvider( log, codeBase, catalog ); } return new CompositionContainer(catalog); }