Search results
Results from the WOW.Com Content Network
A delegate is a form of type-safe function pointer used by the Common Language Infrastructure (CLI). Delegates specify a method to call and optionally an object to call the method on. Delegates are used, among other things, to implement callbacks and event listeners. A delegate object encapsulates a reference to a method.
For instance, when the user clicks the close box, the window manager sends the delegate a windowShouldClose: call, and the delegate can delay the closing of the window, if there is unsaved data represented by the window's contents. Delegation can be characterized (and distinguished from forwarding) as late binding of self: [4]
In the delegate pattern, this is instead accomplished by explicitly passing the original object to the delegate, as an argument to a method. [1] " Delegation" is often used loosely to refer to the distinct concept of forwarding , where the sending object simply uses the corresponding member on the receiving object, evaluated in the context of ...
Delegate (CLI), a form of type-safe function pointer used by the Common Language Infrastructure (CLI), specifying both a method to call and optionally an object to call the method on. See also [ edit ]
If an identifier is needed which would be the same as a reserved keyword, it may be prefixed by an at sign to distinguish it. For example, @out is interpreted as an identifier, whereas out as a keyword. This syntax facilitates reuse of .NET code written in other languages. [4] The following C# keywords are reserved words: [2]
C# has delegates which are not the same as the function pointers in Java.--Carl Hewitt 21:57, 23 August 2005 (UTC) Java doesn't have function pointers. Anyway, C# doesn't even have closures, and you can't have continuations without closures. C#s delegates (which work more or less like function objects in C++) just don't suffice.
Main page; Contents; Current events; Random article; About Wikipedia; Contact us
Delegate (CLI), a computer programming technique; Delegate (American politics), a representative in any of various political organizations; Delegate (United States Congress), a non-voting member of the United States House of Representatives; Delegate Apostolic or nuncio, an ecclesiastical diplomat representing the Holy See