匿名方法(Anonymous methods) 提供了一种传递代码块作为委托参数的技术delegate void NumberChanger(int n); ... NumberChanger nc = delegate(int x) { Console.WriteLine("Anonymous Method: {0}", x); };
nc(10);