Abstract
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 remove method compiled for the event member by the C# compiler. Finally, we will also explore how different pieces of the event program fit together in runtime.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2013 Mohammad Rahman
About this chapter
Cite this chapter
Rahman, M. (2013). Event. In: Expert C# 5.0. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4861-3_8
Download citation
DOI: https://doi.org/10.1007/978-1-4302-4861-3_8
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-4860-6
Online ISBN: 978-1-4302-4861-3
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)