May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Delegates are type safe function pointers. The main difference between classic function pointers (such as C++ pointers) and delegates is that function pointers can point anywhere, and this can be dangerous, whereas delegates can point only to those methods that respect delegates’ signatures. Delegates hold a reference to a procedure (its address) and enable applications to invoke different methods at runtime, but such methods must adhere to the delegate signature; moreover, delegates enable invoking a method from another object. This is important according to the main purpose of delegates, which is offering an infrastructure for handling events.
Read now
Unlock full access