コード例 #1
0
ファイル: ProxyTest.cs プロジェクト: netcasewqs/nlite
        public void InterfaceProxyTest()
        {
            var h = new InterfaceInvocationHandler { Instance = new Person("张三") };
            var p = (IPerson)NLite.Reflection.Proxy.NewProxyInstance(
                new Type[] { typeof(IPerson) },
                h: h);

            p.Say("李四");

            p.Sex = true;

            Console.WriteLine(p.Sex);
        }
コード例 #2
0
ファイル: ProxyTest.cs プロジェクト: saber-wang/nlite
        public void InterfaceProxyTest()
        {
            var h = new InterfaceInvocationHandler {
                Instance = new Person("张三")
            };
            var p = (IPerson)NLite.Reflection.Proxy.NewProxyInstance(
                new Type[] { typeof(IPerson) },
                h: h);

            p.Say("李四");

            p.Sex = true;

            Console.WriteLine(p.Sex);
        }