Inheritance: ComposablePartCatalog
        public void AssembleComponents()
        {
            SafeDirectoryCatalog sdc = new SafeDirectoryCatalog(Directory.GetCurrentDirectory());
            var test = sdc.Parts;

            try
            {
                var catalog = new AggregateCatalog();
                //catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));
                //catalog.Catalogs.Add(new DirectoryCatalog("."));
                catalog.Catalogs.Add(sdc);
                var container = new CompositionContainer(catalog);
                container.ComposeParts(this);
                foreach (ComposablePartDefinition part in sdc)
                {
                    Logger.Info(part.ToString());
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Unable to assemble all logins error: {0}", ex);
            }
        }
Exemplo n.º 2
0
 public void AssembleComponents()
 {
     SafeDirectoryCatalog sdc = new SafeDirectoryCatalog(Directory.GetCurrentDirectory());
     var test = sdc.Parts;
     try
     {
         var catalog = new AggregateCatalog();
         //catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));                
         //catalog.Catalogs.Add(new DirectoryCatalog("."));
         catalog.Catalogs.Add(sdc);
         var container = new CompositionContainer(catalog);
         container.ComposeParts(this);  
         foreach(ComposablePartDefinition part in sdc)
         {
             Logger.Info(part.ToString());
         }
     }
     catch(Exception ex)
     {
         Logger.Error("Unable to assemble all logins error: {0}", ex);
     }
              
 }