我定義了一個委託類型,如:關於創建委託對象 - 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