protected ServiceManagerWithMefFixture()
 {
     _catalogLazy = new Lazy <ComposablePartCatalog>(() => {
         var catalog = CatalogFactory.CreateAssembliesCatalog(GetAssemblyNames());
         return(FilterCatalog(catalog));
     });
 }
        private CompositionContainer CreateContainer()
        {
            lock (_containerLock) {
                CompositionContainer container;

                string thisAssembly = Assembly.GetExecutingAssembly().GetAssemblyPath();
                string assemblyLoc  = Path.GetDirectoryName(thisAssembly);

                var assemblies = new List <string>();
                assemblies.AddRange(_coreEditorAssemblies);
#if VS14
                assemblies.AddRange(_cpsAssemblies);
                assemblies.AddRange(_projectAssemblies);
#else
                assemblies.AddRange(_projectAssemblies);
#endif
                assemblies.AddRange(_privateEditorAssemblies);
                assemblies.AddRange(_rtvsEditorAssemblies);
                assemblies.AddRange(_additionalAssemblies);

                var             aggregateCatalog    = CatalogFactory.CreateAssembliesCatalog(assemblies);
                AssemblyCatalog thisAssemblyCatalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());
                aggregateCatalog.Catalogs.Add(thisAssemblyCatalog);

                var filteredCatalog = aggregateCatalog.Filter(cpd => !cpd.ContainsPartMetadataWithKey(PartMetadataAttributeNames.SkipInEditorTestCompositionCatalog));
                container = BuildCatalog(filteredCatalog);
                return(container);
            }
        }
Ejemplo n.º 3
0
        private CompositionContainer CreateContainer()
        {
            lock (_containerLock) {
                var assemblies = new List <string>();
                assemblies.AddRange(_coreEditorAssemblies);
                assemblies.AddRange(_rtvsEditorAssemblies);
                assemblies.AddRange(_additionalAssemblies);

                var aggregateCatalog    = CatalogFactory.CreateAssembliesCatalog(assemblies);
                var thisAssemblyCatalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());
                aggregateCatalog.Catalogs.Add(thisAssemblyCatalog);

                var filteredCatalog = aggregateCatalog.Filter(cpd => !cpd.ContainsPartMetadataWithKey(PartMetadataAttributeNames.SkipInEditorTestCompositionCatalog));
                var container       = BuildCatalog(filteredCatalog);
                return(container);
            }
        }
Ejemplo n.º 4
0
 protected override ComposablePartCatalog CreateCatalog() => CatalogFactory.CreateAssembliesCatalog(GetAssemblies().AsList());
 protected ServiceManagerWithMefFixture()
 {
     _catalogLazy = new Lazy <ComposablePartCatalog>(() => CatalogFactory.CreateAssembliesCatalog(GetAssemblyNames()));
 }