static void Main() { ProxyTest test = new ProxyTest(); test.SuperEvent1 += new EventHandler(test_SuperEvent1); Program sink = new Program(); ProxyTypeBuilder builder = new ProxyTypeBuilder("ProxyBuilder"); //Type newType = builder.GenerateInterfaceProxyImplementation<ISampleFace>(); ISampleFace proxy = builder.ObtainProxyInstance <ISampleFace>(sink); Stopwatch sw = new Stopwatch(); Thread.Sleep(500); sw.Start(); for (int i = 0; i < 10000000; i++) { proxy.TestMethod(12, null); object t = proxy.TestMethod2(13, sink); } sw.Stop(); Console.WriteLine(sw.ElapsedMilliseconds); //builder.Save(); //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new Form1()); }
static void Main() { ProxyTest test = new ProxyTest(); test.SuperEvent1 += new EventHandler(test_SuperEvent1); Program sink = new Program(); ProxyTypeBuilder builder = new ProxyTypeBuilder("ProxyBuilder"); //Type newType = builder.GenerateInterfaceProxyImplementation<ISampleFace>(); ISampleFace proxy = builder.ObtainProxyInstance<ISampleFace>(sink); Stopwatch sw = new Stopwatch(); Thread.Sleep(500); sw.Start(); for (int i = 0; i < 10000000; i++) { proxy.TestMethod(12, null); object t = proxy.TestMethod2(13, sink); } sw.Stop(); Console.WriteLine(sw.ElapsedMilliseconds); //builder.Save(); //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new Form1()); }