Skip to main content

Events

  • Chapter
Illustrated C# 2010
  • 739 Accesses

Abstract

The preceding chapter covered delegates. Many aspects of events are similar to those of delegates. In fact, an event is like a simpler delegate that is specialized for a particular use. Figure 16-1 illustrates that, like a delegate, an event has methods registered with it and invokes those methods when it is invoked. The following are some important terms related to events:

  • Raising an event: The term for invoking or firing an event. When an event is raised, all the methods registered with it are invoked—in order.

  • Publisher: A class or struct that makes an event available to other classes or structs for their use.

  • Subscriber: A class or struct that registers methods with a publisher.

  • Event handler:: A method that is registered with an event. It can be declared in the same class or struct as the event or in a different class or struct.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 49.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

© 2010 Daniel M. Solis

About this chapter

Cite this chapter

Solis, D.M. (2010). Events. In: Illustrated C# 2010. Apress. https://doi.org/10.1007/978-1-4302-3283-4_16

Download citation

Publish with us

Policies and ethics