Example #1
0
File: Program.cs Project: qcjwq/MEF
        static void Main(string[] args)
        {
            var demo = new DemoOne();

            var catalog = new AggregateCatalog();
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(IDemo).Assembly));
            CompositionContainer container = new CompositionContainer(catalog);
            container.ComposeParts(demo);
            demo.Run();

            Console.ReadLine();
        }
Example #2
0
File: Program.cs Project: qcjwq/MEF
        static void Main(string[] args)
        {
            var demo = new DemoOne();

            var catalog = new AggregateCatalog();

            catalog.Catalogs.Add(new AssemblyCatalog(typeof(IDemo).Assembly));
            CompositionContainer container = new CompositionContainer(catalog);

            container.ComposeParts(demo);
            demo.Run();

            Console.ReadLine();
        }