O'Reilly logo

Expert C# 5.0: with the .NET 4.5 Framework by Mohammad Rahman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 8

images

Event

This chapter will discuss the event program. A type that defines an event member allows other types to subscribe for the notification when something happened in the type. We start by designing a type, which, when exposed to the event where subscribers are to subscribe, implements the code to handle the event and explains the concept of the event in C# language. We will then explore the behind the scenes workings of the event, for example, how C# compiler translates an event member to implement, add, and remove a method. We also examine how the subscription operator, for example, += and -=, will be translated to use the add and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required