示例#1
0
文件: Program.cs 项目: 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();
        }
示例#2
0
文件: Program.cs 项目: 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();
        }