Jon Jagger
jon@jaggersoft.com
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 22 Delegates Paragraph 1[Note: Delegates enable scenarios that other languages-such as C++, Pascal, and Modula-have addressed with function pointers. Unlike C++ function pointers, however, delegates are fully object oriented, and unlike C++ pointers to member functions, delegates encapsulate both an object instance and a method. end note] Paragraph 21 A delegate declaration defines a class that is derived from the class System.Delegate. 2 A delegate instance encapsulates one or more methods, each of which is referred to as a callable entity. 3 For instance methods, a callable entity consists of an instance and a method on that instance. 4 For static methods, a callable entity consists of just a method. 5 Given a delegate instance and an appropriate set of arguments, one can invoke all of that delegate instance's methods with that set of arguments. Paragraph 31 An interesting and useful property of a delegate instance is that it does not know or care about the classes of the methods it encapsulates; all that matters is that those methods be compatible (§22.1) with the delegate's type. 2 This makes delegates perfectly suited for "anonymous" invocation.
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS