public void Compose(BaseParameters parameters)
{
try
{
var catalog = new AggregateCatalog(new AssemblyCatalog(Assembly.GetExecutingAssembly()),
new AssemblyCatalog(typeof(Logic.SanityCheck).Assembly));
LoadPlugins(catalog, parameters);
var container = new CompositionContainer(catalog);
var batch = new CompositionBatch();
batch.AddPart(this);
batch.AddPart(parameters);
var config = new Configuration(parameters.FileSystem, parameters.Path);
config.ReadFromFile();
batch.AddExportedValue((IConfiguration)config);
container.Compose(batch);
}
catch (ReflectionTypeLoadException ex)
{
Console.WriteLine(@"Unable to load: \r\n{0}",
string.Join("\r\n", ex.LoaderExceptions.Select(e => e.Message)));
throw;
}
}