Summary
Delegates are type-safe function pointers that store the address of a Sub or Function, enabling different methods to be invoked at runtime. Delegates are reference types declared via the Delegate keyword; they enable invoking methods via the Invoke method. They can be used in different programming techniques, but the most important scenario where you use delegates is within event-based programming. Events take advantage of delegates in that the objects require their signature to be respected. Coding events is something that can be divided into main areas, such as catching events and exposing events from your objects. To catch events, you can register and deregister via the AddHandler and RemoveHandler keywords, or you can declare objects ...