18.4. Summary

C# delegates can be thought of as type-safe function pointers. Function pointers are essentially references to actual functions. A delegate can also wrap a call to a series of functions that can be added or deleted dynamically. Because of the indirect nature of the function call, delegates are useful for simulating asynchronous method calls (such as calls to the System.Threading and System.IO namespaces). Delegates are also used in event-based programming in C#. Event programming in C# is similar to the JavaBeans property change listener paradigm. Because you can add or delete functions to a delegate, which in turn points to multiple functions, delegates can conveniently simulate the JavaBeans property change listener paradigm.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.100.42