예제 #1
0
        /// <summary>
        /// 动态代理执行方法
        /// </summary>
        private static void DynamicInvoke()
        {
            IdolProxy idolProxy = new IdolProxy();

            Console.WriteLine(idolProxy.invoke("Idol", "Dance", new object[] { }));
            Console.WriteLine(idolProxy.invoke("Idol", "Smile", new object[] { }));
        }
예제 #2
0
        /// <summary>
        /// 直接通过代理执行方法
        /// </summary>
        private static void Invoke()
        {
            IdolProxy idolProxy = new IdolProxy("板野友美");

            Console.WriteLine(idolProxy.Dance());
            Console.WriteLine(idolProxy.Sing());
            Console.WriteLine(idolProxy.Smile());
        }