static void Compose() { DirectoryCatalog directoryCatalog = new DirectoryCatalog("."); AssemblyCatalog assemblyCatalog = new AssemblyCatalog(Assembly.GetExecutingAssembly()); AggregateCatalog aggregateCatalog = new AggregateCatalog(); aggregateCatalog.Catalogs.Add(directoryCatalog); aggregateCatalog.Catalogs.Add(assemblyCatalog); CompositionContainer container = new CompositionContainer(aggregateCatalog); RefreshCatalog refreshCatalog = new RefreshCatalog(directoryCatalog); container.ComposeParts(refreshCatalog); Application.Run(container.GetExportedValue<MainShell>()); }
static void Compose() { DirectoryCatalog directoryCatalog = new DirectoryCatalog("."); AssemblyCatalog assemblyCatalog = new AssemblyCatalog(Assembly.GetExecutingAssembly()); AggregateCatalog aggregateCatalog = new AggregateCatalog(); aggregateCatalog.Catalogs.Add(directoryCatalog); aggregateCatalog.Catalogs.Add(assemblyCatalog); CompositionContainer container = new CompositionContainer(aggregateCatalog); RefreshCatalog refreshCatalog = new RefreshCatalog(directoryCatalog); container.ComposeParts(refreshCatalog); Application.Run(container.GetExportedValue <MainShell>()); }