Skip to main content

Event

  • Chapter
Expert C# 5.0
  • 1994 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics