Chapter 15. Delegates and Events

Until now you saw how to create and manipulate your objects, working with the result of operations performed onto object instances or shared members. All the work we made until now does not provide a way for understanding the moment when a particular thing happens or for being notified of a happening. In .NET development, as for many other programming environments, getting notifications for happenings and knowing the moment when something happens is accomplished handling events, which are information that an object sends to the caller, such as the user interface or a thread, about its state so that the caller can make decisions according to the occurred event. Events in .NET programming are powerful and provide great granularity about controlling each happening. This granularity can take place because of another feature named delegates, which provide the real infrastructure for event-based programming and, because of this, we first discuss delegates before going into the events discussion.

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

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