/// <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[] { })); }
/// <summary> /// 直接通过代理执行方法 /// </summary> private static void Invoke() { IdolProxy idolProxy = new IdolProxy("板野友美"); Console.WriteLine(idolProxy.Dance()); Console.WriteLine(idolProxy.Sing()); Console.WriteLine(idolProxy.Smile()); }