예제 #1
0
        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>());
        }
예제 #2
0
        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>());
        }