コード例 #1
0
        static void Main(string[] args)
        {
            AggregateCatalog catalog = new AggregateCatalog();
              String baseDir = AppDomain.CurrentDomain.BaseDirectory;
              catalog.Catalogs.Add(new DirectoryCatalog(baseDir));
              catalog.Catalogs.Add(new AssemblyCatalog(typeof(Program).Assembly));
              CompositionContainer container = new FlatCompositionContainer(catalog);

              Program program = new Program();
              container.SatisfyImportsOnce(program);

              program.Run();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            AggregateCatalog catalog = new AggregateCatalog();
            String           baseDir = AppDomain.CurrentDomain.BaseDirectory;

            catalog.Catalogs.Add(new DirectoryCatalog(baseDir));
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(Program).Assembly));
            CompositionContainer container = new FlatCompositionContainer(catalog);

            Program program = new Program();

            container.SatisfyImportsOnce(program);

            program.Run();
        }