我定义了一个委托类型,如:关于创建委托对象 - C#
delegate void DrawShape(Brush aBrush,Rectangle aRect);
你能告诉我,为什么下面的步骤创建委托对象的方法是正确的:
DrawShape DrawRectangleMethod = CreateGraphics().FillRectangle;
DrawShape AnotherDrawRectangleMethod = new DrawShape(CreateGraphics().FillRectangle);
为什么能没有“New”的方法可以正常工作吗?
我认为编译器将两行解释为相同。 – craig1231 2012-01-13 15:48:21