Exemple #1
0
        public void Initialize()
        {
            var thisAssembly   = this.GetType().Assembly;
            var targetAssembly = typeof(AspectHelper).Assembly;

            this.catalog   = new AggregateCatalog(new AssemblyCatalog(thisAssembly), new AssemblyCatalog(targetAssembly));
            this.container = new CompositionContainer(this.catalog);

            AspectHelper.RegisterForComposition(this.container, thisAssembly);

            this.target = this.container.GetExportedValue <TestMef>();
        }
Exemple #2
0
 public void Cleanup()
 {
     this.container.Dispose();
     this.catalog.Dispose();
     this.target = null;
 }