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.
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
© 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
DOI: https://doi.org/10.1007/978-1-4302-3283-4_16
Publisher Name: Apress
Print ISBN: 978-1-4302-3282-7
Online ISBN: 978-1-4302-3283-4
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)